Write a user-defined MATLAB function that determines the circumference of a triangle when the coordinates of the

Question:

Write a user-defined MATLAB function that determines the circumference of a triangle when the coordinates of the vertices are given. For the function name and arguments, use [cr] = cirtriangle (A, B, C). The input arguments A, B, C are vectors with the coordinates of the vertices, and the output variable cr is the circumference. The function should work for a triangle in the x-y plane (each vertex is defined by two coordinates) or for a triangle in space (each vertex is defined by three coordinates). Write the code of cirtriangle such that it has a subfunction or an anonymous function for calculating the distance between two points. Use the function to determine the circumference of triangles with the following vertices:
(a) A = (1, 2), B = (10, 3), C = (6, 11)
(b) A = (-1.5, -4.2, -3), B = (-5.1, 6.3, 2), C = (12.1, 0, -0.5)
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: