Question: Create a Matlab Live Script called Triangle_Area.mlx containing a function named triangle_properties that computes the center of gravity (G) and area (Area) of any given

Create a Matlab Live Script called "Triangle_Area.mlx" containing a function named triangle_properties that computes the center of gravity (G) and area (Area) of any given triangle in 2 dimensions. The input for the function is the coordinate matrix Coord that contains the coordinates of the three vertices (each point is stored in a column). Use the following relationships: G=3A+B+CArea=414a2b2(a2+b2c2)2 Where A,B and C are the coordinates of the vertices of the triangle, and a,b and c are the lengths of the three edges. Use the following coordinates to define the triangle and check your calculations: A=(4,3),B=(5,1),C=(0,2) Optional (10 extra points): write a function called triangle_scaling that scales a given triangle around its centroid by a factor equal to x _scale in the x-direction, and a factor equal to y yscale in the y-direction. The inputs for this function are the coordinate matrix Coord and the values of x _scale and yscale. The output is the scaled coordinate matrix Coord_scaled. Plot both the original triangle and the scaled triangle to check your code (you can use the command patch to visualize the triangles). Hint: the scaling matrix we studied in class scales a given triangle around the origin of the coordinate system. Think of how you can scale the figure around an arbitrary point
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
