Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using matlab 2. The area of a triangle ABC can be calculated by rea =- where|I I is the magnitude of the vector, AB is

image text in transcribed

using matlab

2. The area of a triangle ABC can be calculated by rea =- where|I I is the magnitude of the vector, AB is the distance vector from point A to point B and AC is the distance vector from point A to point C. Write a MATLAB user-defined function, [area] LASTNAMESTriArea (A, B, C), to calculate the area of the triangle using the equation above. The input A, B, and C are 1D arrays containing the XY or XYZ coordinates of the vertices of the triangle, e.g. A [2,3] or A = [1 2 0]. In your function, create -VecCross (vecl,vec2). The VecDist() function returns the distance vector between two points given by vertexl and vertex2. The VecCross function computes the cross product of two vectors given by vecl and vec2. You CANNOT use MATLAB built-in functions to calculate the cross product. Be sure to check for invalid inputs and display proper error/warning messages. Your code must include proper comment lines. Submit your User-Defined Function with Sub-Functions to BeachBoard. (8 Points) ub-functions, vec VecDist (vertex1, vertex2) and out - Using your function above, write down the function call that you use and the answer for the are calculation of a triangle formed by 3 points: (0,0,0), (5.5, 0, 0 and (5.5, -4, 0). (2 Points) Command(s) &

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions