Zaid-LAB - 02 - Jupyter Notebook
Zaid-LAB - 02 - Jupyter Notebook
#LAB 2: Finding angle between two polar curves, curvature and radius of curvature
#1. Angle between two polar curves
#a.Find the angle between the curves r = 4(1 + cost) and r = 5(1 − cost)
from sympy import *
r,t = symbols('r,t')
r1=4*(1+cos(t));
r2=5*(1-cos(t ));
dr1 = diff(r1,t)
dr2 = diff(r2,t)
t1=r1/dr1
t2=r2/dr2
q= solve( r1-r2,t )
w1=t1.subs({t: float ( q[1])})
w2=t2.subs({t: float ( q[1])})
y1= atan(w1)
y2= atan(w2)
w=abs(y1-y2)
print('Angle between curves in radians is %0.3f '%( w))
In [2]:
In [6]:
(𝑎2 )1.5
2𝑎2
In [10]:
Radius of curvature is
1 0.5
−𝑎( sin2 (𝑡) ) sin(𝑡)
Radius of curvature at r=5 and t= pi/2 is -5
t ) . doit () ) ) )
Radius of curvature is
−2.52268924576114
Curvature at (1,pi/4) is -0.39640237166757364