CDM Exercise No: 2(b), Programming and generation of Analytical Curves
1. Write a MATLAB program and Plot the following analytical curves:
a) Plot a parabola given by y= 4a𝑥 ! , 𝑥 = 4a𝑦 ! , y= −4a𝑥 ! , 𝑥 = −4a𝑦 !
"! $! $!
b) Hyperbola given by 4 #! − 3 %! = 1, 𝑥 = √1 + 𝑃; 𝑤ℎ𝑒𝑟𝑒 𝑃 = %!
"! $!
c) Ellipse given by &'#! + !'%! = 1; Assume a = 1, b = 4
2. Write down a MATLAB program and Plot circle using parametric recursive equation. Take center at (2,2)
and radius = 5. Use no. of steps for loop a) 10 c) 100 b)1000. Calculate the elapsed time or run time. List down
your observations.
3. Repeat problem 1(a), 1(b) and 1(c) from CDM practical 2(a) for no. of steps for loop a) 10 c) 100 b)1000.
Prepare an observation table comparing all methods with increased steps. List down your observations.
4. Write down a MATLAB program and plot the parametric equation
(')! +%)
a) 𝑥 = 2𝑎 (*)! , y= (*)! . identify mathematically the curve. Take semi major and minor axis a = 2, b = 3.
b) x= 𝑎 𝑠𝑖𝑛𝑢 , y= 𝑏 𝑠𝑖𝑛𝑢 for 0 £ 𝑢 £ 2P. Compare a) and b) and list your observation.
5. Write down a MATLAB program and plot the parametric equation
# (*)! %
a) x= , , y= 9!: 𝑢. identify mathematically the curve. Take semi major and minor axis a = 1, b = 15.
)
b) x= 𝑎 𝑠𝑒𝑐θ , y= 𝑏 𝑡𝑎𝑛θ for 0 £ 𝑢 £ P/2. Compare a) and b) and list your observation.