Triangle plotting help, area, perimeter

3 visualizaciones (últimos 30 días)
Dylan
Dylan el 17 de Feb. de 2014
Respondida: Roger Stafford el 17 de Feb. de 2014
This is the problem, I have no idea how to do this. 1. Write a MATLAB script called Triangle to calculate the perimeter P of the triangle A-B-C defined by the x and y coordinates of points A, B, and C as listed below.
The length of triangle side a = sqrt( (Bx – Cx)2 + ( By– Cy)2 ),
Where Bx and Cx are the x-coordinates of points B and C, and By and Cy are the y-coordinates of points B and C.
Therefore for the points shown below, length of side a = sqrt( (220 – 480)2 + ( 320 – 230)2 )
x y Point coordinates in feet: A ( 90 , 130 ) B ( 220 , 320 ) C ( 480 , 230 )
2. Add to the script a formula for calculating the area of the triangle

Respuestas (1)

Roger Stafford
Roger Stafford el 17 de Feb. de 2014
Hint: Once you have solved the first part, go here to see one way to solve 2.:
http://mathworld.wolfram.com/HeronsFormula.html
There are other formulas for finding the area, however, for which numerical computation is more accurate. One I am thinking of involves the cross product of two vectors. Another makes use of a certain determinant. (End of hints.)

Categorías

Más información sobre Discrete Data Plots en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by