Concept explainers
The area of a triangle ABC can be calculated by:
where AB is the vector from vertex A to vertex B and AC is the vector from vertex A to vertex C. Write a user-defined MATLAB function that determines the area of a triangle given its vertices’ coordinates. For the function name and arguments, 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 vectors AB and AC and another that executes the cross product. (If available, use the user-defined
(a) A = (1,2), B = (10,3), C = (6,11)
(b) A = (-1.5, -42, -3), 8= (-5.1,6.3,2), C= (12.1,0,- 1.5)
Want to see the full answer?
Check out a sample textbook solutionChapter 7 Solutions
Matlab
- Algebra & Trigonometry with Analytic GeometryAlgebraISBN:9781133382119Author:SwokowskiPublisher:CengageLinear Algebra: A Modern IntroductionAlgebraISBN:9781285463247Author:David PoolePublisher:Cengage Learning