Question: Chapter 1 Defined Functions and Function Fil 252 15. The area of a triangle ABC can be calculated by: where AB is the vector from

 Chapter 1 Defined Functions and Function Fil 252 15. The area

Chapter 1 Defined Functions and Function Fil 252 15. The area of a triangle ABC can be calculated by: where AB is the vector from point A to point B and AC is the vector from point A to point C. Write a user-defined MATLAB function that determines the area of a triangle given its vertices' coordinates. For the function name and argu- ments, use [Area] TriArea (A, B, C). The input arguments A, B, and C, are vectors, each with the coordinates of the corresponding vertex. Write the code of TriArea such that it has two subfunctions-one that determines the vec- tors AB and AC and another that executes the cross product. (If available, use the user-defined functions from Problem 14). 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). Use the func- tion to determine the areas of triangles with the following vertices: (a) A = (1,2), B= (10,3), cm(6,11) (b) A = (-1.5,-4.2,-3), B = (-5.1, 63, 2), c = (12.1,0,-0.5)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!