Question: Q2) Extend the program you wrote in P1 in a way that calculates the perimeter or circumference of each shape as well. P1 (20%). Figure

P1 (20%). Figure 1 shows the geometry formulas for common 2D shapes.

Q2) Extend the program you wrote in P1 in a way that calculates the perimeter or circumference of each shape as well.

P1 (20%). Figure 1 shows the geometry formulas for common 2D shapes. Write a MATLAB program that ask the user about the shape, as well as corresponding parameters and calculate the area. DI SQUARE s=side Area: A = Perimeter: P = 4s RECTANGLE 1 = length, w = width Area: Alw Perimeter: P = 21+ 2 TRIANGLE b= base, h= height Area: Abh Perimeter: Pa+b+c EQUILATERAL TRIANGLE 8 = side Height: h=s Area: A = 4 PARALLEL OG RAM b base, h= height, a side Area: A = bh Perimeter: P = 2a + 2b TRAPEZOID a.b= bases; h= height: c, d = sides Area: A = (a + b)h Perimeter: P=a+b+c+d ih 1h b a b d CIRCLE r-radius, d= diameter Diameter: d=2r Area: A = r Circumference: C=2ar=nd SECTOR OF CIRCLE r = radius, @= angle in radians Area: A = 40 Are Length: Or ELLIPSE a semimajor axis b= semiminor axis Area: Arab Circumference: Cr(3(a+b) (a + 3b)(b +3a) ANNULUS rinner radius, Router radius Average Radius: p=(r + R) Width: w R-r Area: A = (R-) or A = 2x pu REGULAR POLYGON s side length. n = number of sides Circumradius: R=sese() Area: Anscot (=) or A = nR sin(2) 8 b r R

Step by Step Solution

3.35 Rating (155 Votes )

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 Programming Questions!