In: Advanced Math
Given the parametrized curve r(u) = a cos u(1 − cos u)ˆi + a sin u(1 − cos u)ˆj, u ∈ [0, 2π [ , (with a being a constant)
i) Sketch the curve (e.g. by constructing a table of values or some other method)
ii) Find the tangent vector r 0 (u). What is the tangent vector at u = 0? And at u = 2π? Explain your result.
iii) Is the curve regularly parametrized? Motivate your answer using the definition.
iv) Compute the length of the arc corresponding to the interval [0, π/2].
%%Matlab code for plotting parametric curve
clear all
close all
%function for r(u)
rx=@(u,a) (a.*cos(u)).*(1-(cos(u)));
ry=@(u,a) (a.*sin(u)).*(1-(cos(u)));
%let us consider a=5;
tt=linspace(0,2*pi,25);
%printing rx and ry data for a=5;
fprintf('\tPrinting ux and uy data for a=5\n')
rxx=rx(tt,5); ryy=ry(tt,5);
r=[rxx' ryy'];
disp(r)
tt=linspace(0,2*pi,250);
plot(rx(tt,5),ry(tt,5))
xlabel('x')
ylabel('y')
title('plot for r(u) for a=5');
box on
%tangent equation
syms a u
r1x(u,a) = (a.*cos(u)).*(1-(cos(u)));
r1y(u,a) = (a.*sin(u)).*(1-(cos(u)));
tang(u,a)=diff(ry,u)/diff(rx,u);
fprintf('Equation for tangent line at u=0 is')
y=@(x) ry(0.001,5)+double(tang(0.001,5))*(x-rx(0.001,5));
disp(y)
xx=linspace(-4,2);
yy=y(xx);
hold on
plot(xx,yy)
ylim([-8 8])
fprintf('Equation for tangent line at u=0 is')
y=@(x)
ry(2*pi+0.001,5)+double(tang(2*pi+0.001,5))*(x-rx(2*pi+0.001,5));
disp(y)
xx=linspace(-4,2);
yy=y(xx);
hold on
plot(xx,yy)
ylim([-8 8])
intg=@(u)sqrt((5.*cos(u).*sin(u) + 5.*sin(u).*(cos(u) -
1)).^2+(5.*sin(u).^2 - 5.*cos(u).*(cos(u) - 1)).^2);
leng=integral(intg,0,2*pi);
fprintf('Length of the curve is %f\n',leng)
%%%%%%%%%%%%%%% End of Code %%%%%%%%%%%%%%