Question: MATLAB: Using the formula to determine the distance between two points and Heros formula find the area of each triangle then add the two areas

MATLAB:

Using the formula to determine the distance between two points and Heros formula find the area of each triangle then add the two areas together.

Area of a quadrilateral. A quadrilateral is a 2-dimensional figure with 4 sides that may or may not be parallel. You will use 2 different methods to determine the area of a quadrilateral. Create two vectors using the data given below (note the last value of each array is the same as the first to allow the figure to close if you were to plot the quadrilateral).

x = -1.8000 2.7000 3.2000 -0.5000 -1.8000

y = -2.0000 -1.5000 2.0000 3.7500 -2.0000

For the first method of calculating the area of the quadrilateral you should use the formula

Area = (1/2)*[(x1y1 - x2y1) + (x2y3 - x3y2z) + (x3y4 - x4y3) + (x4y1 - x1y4)]

For the second method, you will use Heros formula for finding the area of a triangle where a,

Area = sqrt [ s*(s - a)*(s - b)*(s - c) ]

b, and c are the sides of a triangle and s is the semiperimeter (one half of the perimeter) of the triangle. The plot below (Figure 1) shows a green line that connects the first point and the third point dividing your quadrilateral into two triangles.

Using the formula to determine the distance between two points and Heros formula find the area of each triangle then add the two areas together.

*****FIGURE is a trapezoid with parallel bases. The bottom base is larger than the top. The bottom left corner is labeled ''1", bottom right is "2", top right is "3", and top left is "4". The green diagonal line is located diagonally between 1 and 3 (bottom left to top right).

Thank you!!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!