Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedFigure 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. Extend the program you wrote in P1 in a way that calculate the perimeter or circumference of each shape as well.

For square, circle, rectangular, triangle, sector of circle and ellipse, write a program that ask the user for the shape and plot each shape given the parameters provided. The program should plot the geometry in the first quadrant.

For circle, square and ellipse write a program to find the area, perimeter (or circumference) for a range of parametric values given by

the user and plot the corresponding shapes in the range given. User needs to identify lower and upper values of each parameter. The identified range for the parameters should be then divided into 10 monotonic steps inside your program. Accordingly, you need to calculate the values and plot the shapes corresponding to all 10 values in the range identified by the user. The program should plot the geometries in the first quadrant.

SQUARE s = side Area: A=s? Perimeter: P = 4s CIRCLE r = radius, d = diameter Diameter: d=2r Area: A= r Circumference: C=2 =nd RECTANGLE I = length = width Area: A=Ine Perimeter: P = 22 + 2 SECTOR OF CIRCLE r = radius. 8 = angle in radians Area: A = 10,2 Are Length: s=or TRIANGLE b = base, h = height Area: A = oh Perimeter: P= a + b + c ELLIPSE a= semimajor axis b = seriminor axis Area: A=Tab Circumference: CA3(a+h)-Va+36)(b + 3a) EQUILATERAL TRIANGLE S = side Height: h= Area: A=74 ANNULUS r=inner radius, R= outer radius Average Radius: p= }(r+R) Width: w = R -T Area: A = (R? - 2) or A = 2x pee PARALLEL OG RAM b = base, h = height, = side Area: A bh Perimeter: P = 2a + 2b TRAPEZOID a.b = bases: h = height: e, d = sides Area: A = (a + b Perimeter: P = a +b+c+d REGULAR POLYGON s=side length. 11 = number of sides Circumradius: R= is cs() Area: A = ins-cot ) or A = Rasin()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mastering Real Time Analytics In Big Data A Comprehensive Guide For Everyone

Authors: Lennox Mark

1st Edition

B0CPTC9LY9, 979-8869045706

More Books

Students also viewed these Databases questions