*NEED MATLAB CODES, THANK YOU SO MUCH IN ADVANCE* 1. By using MATLAB find the ar
ID: 2873099 • Letter: #
Question
*NEED MATLAB CODES, THANK YOU SO MUCH IN ADVANCE*
1. By using MATLAB find the area of the triangle with vertices (3,1,0),
(1,1,1) and (0, -2,-1).
Next, we investigate curves in three dimensions. For many of these
problems, the output is a picture. Be sure to title the pictures
using the ``title'' command.
2. Consider the helix (vector)
r(t) = (cos t) i+(sin t) j+t/(2*pi) k for 0<= t<= 4*pi
where i, j and k are unit vectors. Run the following script.
t=linspace(0,4*pi,101);
x=inline('cos(t)');
y=inline('sin(t)');
z=inline('t/(2*pi)');
plot3(x(t),y(t),z(t))
hold on
% Add the velocity vectors.
for s=linspace(0,4*pi,17);
p=[x(s),y(s),z(s)];
v=[-sin(s),cos(s),1/(2*pi)];
arrow3(p,v,'r')
end
view(135,40)
hold off
3. Repeat problem 2 for the curve r(t) = t i + (t^2/2)j + (t^3/3)k
for -2<= t<= 2. If you follow
the model of problem 2 beware to write ``y=inline('t.^2/2')" etc.
Now let's calculate lengths of curves. Let C be parametrized by
the vector
r(t)=t i+ (t^2/2) j + (t^3/3)k where 0<= t <= 2.
4. First, we approximate the length of C by making a polygonal
approximation.
t=0:.02:2;
x=t; y=t.^2/2; z=t.^3/3;
sum=0;
for j=1:100
dx=x(j+1)-x(j);
dy=y(j+1)-y(j);
dz=z(j+1)-z(j);
dr=[dx, dy, dz];
sum=sum+norm(dr);
end
disp('Length of the polygonal appox. using 100 seqments')
sum
5. Next we will use the numerical integrator ``quadl''. We have
||r'(t)|| = sqrt{1 + t^2 + t^4} .
The arclength integral cannot be computed by hand. So do
speed=inline('sqrt(1+t.^2+t.^4 )')
s=quadl(speed,0,2)
Compare your answer with the answer for problem 4.
6. Let the curve C be parametrized by the vector
P(t) = (1 - cos t)i + (1 + 2t + t^2)j .
(a) Calculate by hand a tangent vector to the curve at P(0).
(b) Use MATLAB to compute the secant vectors (P(t)-P(0))/t for t = .2,
.1, .05. The error
in the secant approximation is
(P(t)- P(0))/t - P'(0).
By what factor is the error in each component decreased when t is cut in
half?
(c) Plot the curve C for 0<= t<= 1 and use the {f arrow} feature to
plot each of these secant
vectors as well as the tangent vector computed in part (a). Attach each
of these
vectors to the point P(0) = (0, 1).
Explanation / Answer
To find the area of the triangle formed by the vertices,
.
Find :
The area of the triangle is .
Use the MatLab to find the area of the triangle .
MatLab Input & Output:
A = [-2 0 1];
B = [-3 -3 -1];
C = cross(A,B)
C =
3 -5 6
Now, find the magnitude of the obtained vector by using MatLab.
MatLab Input & Output:
sv=C.*C
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.