Question: A trapezoid is a 4-sided flat shape with straight sides that has a pair of opposite sides parallel. Area of a trapezoid is calculated using

 A trapezoid is a 4-sided flat shape with straight sides that

A trapezoid is a 4-sided flat shape with straight sides that has a pair of opposite sides parallel. Area of a trapezoid is calculated using the following formula D C a + b A== -h 2 Here, 'a' and 'b' are the lengths of the parallel sides and 'h' is the height of the trapezoid as shown in the figure. b A B Trapezoid If coordinates of C and D are given, 'a' can be determined by calculating the distance CD. Similarly, if coordinates of A and B are given, 'b' can be determined by calculating the distance AB. The formula for calculating the distance between two coordinates (xl,yl) and (x2,72) is shown below - Distance = (x2-x1)2 + (y2 - y1)2 To calculate the height, we can get some help from trigonometry. Here - h sin header file has to be included in order to use the sin() function. The angle given as input in the sin() function must be in radian. Return type of the user defined function will be float

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!