Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
6 views

Lab2 Revised

The document describes algorithms for finding the angle between two polar curves and the radius of curvature of a curve. It provides examples of applying the algorithms to find the angle between polar curves defined by different functions and the radius of curvature at given points for curves defined parametrically or in polar form.

Uploaded by

shriomraikar217
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Lab2 Revised

The document describes algorithms for finding the angle between two polar curves and the radius of curvature of a curve. It provides examples of applying the algorithms to find the angle between polar curves defined by different functions and the radius of curvature at given points for curves defined parametrically or in polar form.

Uploaded by

shriomraikar217
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

2) Finding angle between polar curves, radius of curvature of given

curve
a) Finding angle between polar curves
ALGORITHM
Step 1: Start
Step 2: declare theta
Step 3: Read r1 & r2
Step 4: Differentiate r1 & r2 with respect to theta
Step 5: Calculate t1 = dr1/r1 and t2 = dr2/r2
Step 6: Solve theta at r1 == r2
Step 7: Substitute theta to t1 & assign to w1
Step 8: Substitute theta to t2 & assign to w2
Step 9: check w1 < 0 then calculate y1 = pi-acot(abs(w1))
Else calculate y1= acot(w1)
Step 10: Repeat step 9 with w2<0 and calculate y2
Step 11: Compute value y as absolute (y1 – y2)
Step 12: Display angle between polar curves “y”
Step:13: Stop
Example 1:- Finding angle between polar curves r1 = 4cos(θ) and
r2 = 4sin(θ)
syms theta
r1 = 4*cos(theta);
r2 = 4*sin(theta);
dr1 = diff(r1,theta);
dr2 = diff(r2,theta);
t1 = dr1/r1;
t2 = dr2/r2;
q = solve(r1 == r2, theta,'PrincipalValue',true);
w1 = subs(t1,[theta],[q]);
w2 = subs(t2,[theta],[q]);
if w1<0
y1 = pi - acot(abs(w1));
else
y1 = acot(w1);
end
if w2<0
y2 = pi - acot(abs(w2));
else
y2 = acot(w2);
end
y = abs(y1 - y2)

Output
r1 =
r2 =
dr1 =
dr2 =
t1 =

t2 =

w1 =
w2 =
y1 =

y2 =

y =
Example 2: Finding angle between polar curves r1 = sin(θ)+cos(θ) and
r2 = 2sin(θ)
syms theta a
r1 = sin(theta)+cos(theta )
r2 = 2*sin(theta);
a=4;
dr1 = diff(r1,theta);
dr2 = diff(r2,theta);
t1 = dr1/r1;
t2 = dr2/r2;
q = solve(r1 == r2, theta,'PrincipalValue',true);
w1 = subs(t1,[theta],[q]);
w2 = subs(t2,[theta],[q]);
if w1<0
y1 = pi-acot(abs(w1));
else
y1 = acot(w1);
end
if w2<0
y2 = pi - acot(abs(w2));
else
y2 = acot(w2);
end
y = abs(y1 - y2)
Output
r1 =
r2 =
dr1 =
dr2 =
t1 =

t2 =

w1 =
w2 =
y1 =

y2 =

y =
Example 3: Finding angle between polar curves r1 = 1+sin(θ)) and
r2 = 1-sin(θ)
syms theta
r1 = 1+sin(theta);
r2 = 1-sin(theta);
a=4;
dr1 = diff(r1,theta);
dr2 = diff(r2,theta);
t1 = dr1/r1;
t2 = dr2/r2;
q = solve(r1 == r2, theta,'PrincipalValue',true);
w1 = subs(t1,[theta],[q]);
w2 = subs(t2,[theta],[q]);
if w1<0
y1 = pi-acot(abs(w1));
else
y1 = acot(w1);
end
if w2<0
y2 = pi - acot(abs(w2));
else
y2 = pi - acot(w2);
end
y = abs(y1 - y2)
Output
r1 =
r2 =
dr1 =
dr2 =
t1 =

t2 =

w1 =
w2 =
y1 =

y2 =

y =
b) Finding radius of curvature of given curve
ALGORITHM
Step 1: Start
Step 2: Declare syms r t
Step 3: Read r
Step 4: Differentiate r w.r.t t = r1
Step 5: Differentiate r1 w.r.t t = r2
Step 6: Calculate rho (formula (r2 +r12) (3/2)/(r2+2r12-r*r2))
Step 7: substitute rho in rho1
Example 1:- Find radius of curvature for r = acost at t = π /2
Code:
syms r t
a=4;
r = a*cos(t) ;
r1 = diff(r,t);
r2 = diff(r1,t);
rho = (r.^2+r1.^2).^(1.5)/(r.^2+2*r1.^2-r*r2)
rho1 = subs(rho,[t],[pi/2])

Output
r =
r1 =
r2 =

rho =

rho1 =

Example 2:- Find radius of curvature for r = a(1+cosθ) at θ = π /2


syms r theta
a=4;
r = a*cos(theta)^3 ;
r1 = diff(r,theta);
r2 = diff(r1,theta);
rho = (r.^2+r1.^2).^(1.5)/(r.^2+2*r1.^2-r*r2)
rho1 = subs(rho,[theta],[0])
Output
r =
r1 =
r2 =

rho =

rho1 =
Example 3:- Find radius of curvature for r = a(t-sin(θ))) at θ = π /2

syms r theta
a=4;
r = a*(theta-sin(theta)) ;
r1 = diff(r,theta);
r2 = diff(r1,theta);
rho = (r.^2+r1.^2).^(1.5)/(r.^2+2*r1.^2-r*r2)
rho1 = subs(rho,[theta],[pi/2])

Output
r =
r1 =
r2 =

rho =

rho1 =
II) Radius of curvature of parametric form
ALGORITHM
Step 1: Start
Step 2: Declare syms x y t
Step 3: Read x y
Step 4: Differentiate x w.r.t t = r1
Step 5: Differentiate y w.r.t t = r2
Step 6: Differentiate r1 w.r.t t = r3
Step 7: Differentiate r2 w.r.t t = r4
Step 8: Calculate rho (formula= (r12 +r22) (1.5)/(r1*r4-r2*r3) )
Step 9: substitute rho in rho1
Example 1:- Find radius of curvature for x = a(θ-sin(θ)) and y = a(1-cos(θ))
at θ = π
Code:
syms r theta
a=4;
x = a*(theta-sin(theta))
y = a*(1-cos(theta))
r1 = diff(x,theta);
r2 = diff(y,theta);
r3 = diff(r1,theta);
r4 = diff(r2,theta);
rho = (r1.^2+r2.^2).^(1.5)/(r1*r4-r2*r3)
rho1 = subs(rho,[theta],[pi])
Output:
x =
y =
r1 =
r2 =
r3 =
r4 =

rho =

rho1 =
Example 2: Find radius of curvature for x = a(1-cos(t)) and y = a(t-
sin(t)) at t = π /2

syms r theta
a=4;
x = a*(1-cos(theta))
y = a*(theta-sin(theta))
r1 = diff(x,theta);
r2 = diff(y,theta);
r3 = diff(r1,theta);
r4 = diff(r2,theta);
rho = (r1.^2+r2.^2).^(1.5)/(r1*r4-r2*r3)
rho1 = subs(rho,[theta],[pi/2])
Output:
x =
y =
r1 =
r2 =
r3 =
r4 =
rho =

rho1 =

Example 3: Find radius of curvature for x = acos(θ)3 and y = a(1-


cos(θ)) at t = π /4

syms r theta
a=4;
x = a*(cos(theta)^3)
y = a*(1-cos(theta))
r1 = diff(x,theta);
r2 = diff(y,theta);
r3 = diff(r1,theta);
r4 = diff(r2,theta);
rho = (r1.^2+r2.^2).^(1.5)/(r1*r4-r2*r3)
rho1 = subs(rho,[theta],[pi/4])
Output:

x =
y =
r1 =
r2 =
r3 =
r4 =

rho =

rho1 =

You might also like