CHAPTER 10 - Vectors and Analytic Geometry in Space
Section 10.1, page 794
Problem 30
> | eqn:=x^2-6*x*y(x)+8*y(x)^2-2*x-1=0; |
> | slope:=solve(diff(eqn,x),diff(y(x),x)); |
> | subs(x=1,y(1)=1,slope); |
So the slope of the graph is 3/5 at the point. A vector in this direction is [1,3/5], but to make it a unit vector, we divide by the length:
> | len:=sqrt(1^2+(3/5)^2); |
> | tanvec:=simplify([1/len,3/5/len]); |
> | normvec:=[tanvec[2],-tanvec[1]]; |
> | oppnormvec[1]^2+oppnormvec[2]^2; |
(Just checking.)
Section 10.2, page 804
Problem 53
> | P1:=[1,4,5]; P2:=[4,-2,7]; |
> | dotp:=(V,W)->V[1]*W[1]+V[2]*W[2]+V[3]*W[3]; |
> | dist:=sqrt(dotp(P1-P2,P1-P2)); |
> | direction:=(P2-P1)/dist; |
Section 10.3, page 812
Problem 57
At the first point:
> | tanvec1:=[1,subs(x=xvals[1],diff(y1,x))]; |
> | tanvec2:=[1,subs(x=xvals[1],diff(y2,x))]; |
We'll use the "dotp" program defined as above to get the angle between these vectors:
> | dotp:=(V,W)->V[1]*W[1]+V[2]*W[2]; |
> | angle1:=arccos(dotp(tanvec1,tanvec2)/sqrt(dotp(tanvec1,tanvec1)*dotp(tanvec2,tanvec2))); |
Now for the second point:
> | tanvec1:=[1,subs(x=xvals[2],diff(y1,x))]; |
> | tanvec2:=[1,subs(x=xvals[2],diff(y2,x))]; |
Of course, since these are the same vectors in the opposite order, the angle is the same.
Section 10.4, page 820
Problem 37
We'll assume that the vertices are in fact those of a parallelogram. So we'll take two vectors AB and AD. We'll put them in three dimensions so we can take cross products.
> | AB:=[2,0,0]-[-1,2,0]; AD:=[4,3,0]-[-1,2,0]; |
> | cprod:=(V,W)->[V[2]*W[3]-V[3]*W[2],V[3]*W[1]-V[1]*W[3],V[1]*W[2]-V[2]*W[1]]; |
So the area of the parallelogram is 13.
Section 10.5, page 827
Problem 27
We'll write the lines parametrically as follows:
> | line1:=[2*t+1,3*t+2,4*t+3]; line2:=[s+2,2*s+4,-4*s-1]; |
We want to solve for the values of s and t where the lines meet - you can only solve two equations for two unknowns, so we'll just use two of the coordinates (and then check the third -- remember, in general, lines in 3-space don't meet):
> | sol:=solve({line1[1]=line2[1],line1[2]=line2[2]},{s,t}); |
> | subs(sol,line1),subs(sol,line2); |
So the intersection point is (1,2,3). To find the plane, note that from the parametrizations of the lines, the vectors
> | V1:=diff(line1,t); V2:=diff(line2,s); |
are along the lines. We calculate their cross product using the cprod program from the preceding section:
This is the normal vector to the plane, and we get the equation of the plane as:
> | -20*x+12*y+z=subs(x=1,y=2,z=3,-20*x+12*y+z); |
Section 10.6, page 839
Problem 52
> | plot3d(x^2+y^2+1,x=-3..3,y=-3..3); |
A better parametrization is polar:
> | x:=r*cos(t); y:=r*sin(t); |
> | plot3d([x,y,x^2+y^2+1],r=0..3,t=0..2*Pi); |
This is a paraboloid.
Section 10.7, page 846
Problem 43
We're starting from the equation . We'll plot the surface using this as a parametrization:
> | x:=rho*sin(phi)*cos(theta); y:=rho*sin(phi)*sin(theta); z:=rho*cos(phi); |
> | plot3d([x,y,z],theta=0..2*Pi,phi=0..Pi,scaling=constrained); |
The surface is "apple shaped" - the rotation of a cardioid around the z-axis.