Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
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

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: 3

blur-text-image

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

Microsoft SQL Server 2012 Unleashed

Authors: Ray Rankins, Paul Bertucci

1st Edition

0133408507, 9780133408508

More Books

Students also viewed these Databases questions

Question

Write a Python program to check an input number is prime or not.

Answered: 1 week ago

Question

Write a program to check an input year is leap or not.

Answered: 1 week ago

Question

2 The main characteristics of the market system.

Answered: 1 week ago