please help me with sample coding!!!! .y1), (Zgy), and The area of a triangle wh
ID: 3402232 • Letter: P
Question
please help me with sample coding!!!!
.y1), (Zgy), and The area of a triangle whose three vertices are points( (x3, ys) (see Figure 6.6) can be found from the equation 6.8 (6.12) where || is the determinant operation. The area returned will be positive if the points are taken in counterclockwise order and negative if the points are taken in clockwise order. This determinant can be evaluated by hand to produce the following equation 112 Write a function area2d that calculates the area of a triangle, given the three bounding points (xi,yi), (x2./2), and (xs, ys) using Equation (6.13). Then test your function by calculating the area of a triangle bounded by the points (0,0), (10,0), and (15,5).Explanation / Answer
x1=input('x1=');
y1=input('y1=');
x2=input('x2=');
y2=input('y2=');
x3=input('x3=');
y3=input('y3=');
v1=[x1 y1];
v2=[x2 y2];
v3=[x3 y3];
a=sqrt((x1-x2)^2+(y1-y2)^2);
b=sqrt((x2-x3)^2+(y2-y3)^2);
c=sqrt((x3-x1)^2+(y3-y1)^2);
if a > 0 & b > 0 & c > 0 & (a + b > c) & (a + c > b) & (b + c > a)
plot([x1 x2 x3 x1],[y1 y2 y3 y1])
else
end
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.