<type 'list'> <type 'tuple'> <type 'list'> <type 'tuple'> |
|
|
|
|
(2, -3, 6) (2, -3, 6) |
arccos(1/42*sqrt(14)*sqrt(21)) arccos(1/42*sqrt(14)*sqrt(21)) |
Let's make a function that projects one vector onto another vector.
-3 -3 |
|
|
<type 'sage.modules.vector_rational_dense.Vector_rational_dense'> <type 'sage.modules.vector_rational_dense.Vector_rational_dense'> |
|
|
|
|
Click to the left again to hide and once more to show the dynamic interactive window |
To calculate the magnitude of the projection (i.e., the component of \vec u in the direction of \vec v), we can split the projection up into its magnitude and direction: \left(\frac {\vec u \cdot \vec v}{||\vec v||}\right)\frac{\vec v}{||\vec v||}.
To calculate the magnitude of the projection (i.e., the component of u in the direction of v), we can split the projection up into its magnitude and direction: \left(\frac {\bf u \cdot \bf v}{||\bf v||}\right)\frac{\bf v}{||\bf v||}.
6/5 6/5 |
The component of \vec u that is orthogonal to \vec v is found by vector subtraction.
The component of u that is orthogonal to v is found by vector subtraction.
(51/25, 68/25) (51/25, 68/25) |
Alternately, we might replace v with a vector w that is orthogonal to v, and then find the projection of u onto w:
(51/25, 68/25) (51/25, 68/25) |
The projection of u onto v and the orthogonal component represent perpendicular vectors which, together with u, form a right triangle. Naturally, then, u is the sum of these components.
u is (3, 2) and the sum of the components is likewise (3, 2) u is (3, 2) and the sum of the components is likewise (3, 2) |
There are several ways to plot equations in three variables, all of which must first be declared to be variables. One way is to use the implicit_plot3d( ) command. We plot the plane
2x + 3y - z = 4
and set the "viewing box" using this command below. Note the double-equals used when entering the equation.
|
|
|
|
Next, we display the two vectors defined above, the plane containing them, and the cross product (vector) of u and v, which is naturally normal to the plane containing u and v.
|
|
More fancy: We show u (red), v (blue), the cross product of u and v (orange), and the projection of u onto v (black). We also show the parallelogram whose area equals the length of the cross product.
|
|
Recall that many surfaces are graphs of an equation z = f(x, y). The partial derivatives of f provide "rates of change" along the surface---i.e., both (1, 0, f_x) and (0, 1, f_y) lie in the tangent plane. You just have to decide at what target point (x_0, y_0) you seek these items. In the next cell, we plot the surface z = 2x^2 + y^2 with target point (-1, 2), the vectors (1, 0, f_x) and (0, 1, f_y) above the target point, the tangent plane containing these vectors, and the normal to the surface.
|
|