1. ## Matlab exercise

I am clueless on how to do this exercise I was assigned in my calculus class (even my professor isn't that knowledgeable about MATLAB):

Using the parametric representation $x = cosh(t)$ , $y = sinh(t)$ , plot the curve $1= x^{2} - y^{2}$. Include portions of both branches of this hyperbola. Then add the normalvectors to the plot of the curve. (Your plot should only show arrows attached to the hyperbola, not covering a 2D region.) Make sure you adjust the scales using axis equal to preserve orthogonality. Publish your M-file, including the graphic output.

2. Originally Posted by Pinkk
I am clueless on how to do this exercise I was assigned in my calculus class (even my professor isn't that knowledgeable about MATLAB):

Using the parametric representation $x = cosh(t)$ , $y = sinh(t)$ , plot the curve $1= x^{2} - y^{2}$. Include portions of both branches of this hyperbola. Then add the normalvectors to the plot of the curve. (Your plot should only show arrows attached to the hyperbola, not covering a 2D region.) Make sure you adjust the scales using axis equal to preserve orthogonality. Publish your M-file, including the graphic output.
The basic plot (single branch) is simple:

Code:
t=-1:0.1:1;
x=cosh(t);y=sinh(t);

plot(x,y);
The normal vector's gradients you will need to calculate yourself and then use the quiver function to plot the normals. For help on this type "help quiver" at the command prompt.

CB

3. Thank you. Like I said, our professor really hasn't gone over much in MATLAB so far.

4. Okay, so this is what I came up with:

Code:
t=-2:0.1:2;
x1=cosh(t);y1=sinh(t);x2=-cosh(t);y2=sinh(t);
dx1=2*sinh(t);dy1=-2*cosh(t);dx2=-2*sinh(t);dy2=dy1;
plot(x1,y1)
hold on
plot(x2,y2)
hold on
quiver(x1,y1,dx1,dy1)
hold on
quiver(x2,y2,dx2,dy2)
axis equal
xlabel('x');ylabel('y');zlabel('z')
grid on
title('Exercise 8.2 by Brent Daniels')
The result is this figure:

This doesn't seem right, though. $\nabla f(x,y) = <2x,-2y>$ since this figure is essentially a level curve of $z=x^{2}-y^{2}$. Therefore, shouldn't all the normal vectors on the lower halves of the two branches be pointing in the opposite direction? Or is my code/approach wrong? Thanks.

Edit: Nevermind, I'm an idiot and found my mistake. What essentially I was plotting was $<2\frac{dx}{dt},-2\frac{dy}{dt}>$ instead of $<2x,-2y>$. Thanks again.