MATH 251: Calculus 3, SET8
12: Vectors and the Geometry of Space
12.3: The Dot Product
These problems are done with the CAS. See Hand Solutions for details.
The dot product of two vectors specified via components is computed.
a = sym([3 2 -1]), b = sym([4 0 5])
The dot product of two vectors specified via magnitudes and included angle is computed.
length_of_a = 80, length_of_b = 50, theta = sym(3*pi/4)
length_of_a = 80
length_of_b = 50
a_dot_b = length_of_a * length_of_b * cos(theta)
The dot products of vectors are computed using a figure in the statement of the problem.
length_of_u = sym(1), length_of_v = sym(1/sqrt(2)), length_of_w = 1
alpha = sym(pi/4), beta = sym(pi/2)
u_dot_v = length_of_u * length_of_v * cos(alpha)
u_dot_w = length_of_u * length_of_w * cos(beta)
The angles of a triangle with specified vertices are computed.
A = [1 0 -1], B = [3 -2 0], C = [1 3 3]
alpha = acosd(dot(B-A, C-A) / (norm(B-A) * norm(C-A)))
beta = acosd(dot(A-B, C-B) / (norm(A-B) * norm(C-B)))
gamma = acosd(dot(A-C, B-C) / (norm(A-C) * norm(B-C)))
check = alpha + beta + gamma % Sum of angles of triangle equals 180 degrees.
Pairs of vectors are determined to be orthogonal (perpendicular), parallel, or neither.
u = [-5 4 -2], v = [3 4 -1]
u_dot_v = dot(u,v) % Since dot product is nonzero, the vectors are not perpendicular.
u_by_b = u./v % Since u is not a constant multiple of V, the vectors are not parallel.
% Therefore, the vectors are neither perpendicular nor parallel.
u = [9 -6 3], v = [-6 4 -2]
u_by_v = u./v % Since u = 1.5*v is a constant multiple of v, u and v are parallel.
u = [c c c], v = [c 0 -c]
u_dot_v = dot(u,v) % Since dot product is zero, the vectors are perpendicular.
Two unit vectors are found that make an angle of with a specified vector.
v = sym([3 4]) % the specified vector
u = v / norm(v) % a unit vector in the direction of the specified vector
u_polar = [1 alpha] % polar representation of u
w = [1 alpha+pi/3] % Rotate u clockwise 60 degrees (pi/3 radians)
z = [1 alpha-pi/3] % Rotate u counterclockwise 60 degrees (pi/3 radians)
w_rect = double(1*[cos(w(2)), sin(w(2))]) % w in rectangular components (approx)
z_rect = double(1*[cos(z(2)), sin(z(2))]) % z in rectangular components (approx)
w_angle = atan2d(w_rect(2), w_rect(1)) % angle in deg for w w.r.t. positive x-axis (approx)
z_angle = atan2d(z_rect(2), z_rect(1)) % angle in deg for z w.r.t. positive x-axis (approx)
length_of_w = norm(w_rect) % unit vector
length_of_z = norm(z_rect) % unit vector
quiver(0,0, 3/5,4/5, 'b', 'AutoScale', 'off'); grid on; hold on
quiver(0,0, w_rect(1),w_rect(2), 'r', 'AutoScale', 'off')
quiver(0,0, z_rect(1),z_rect(2), 'm', 'AutoScale', 'off')
plot([0 0], [-0.5 1], 'k')
axis equal; axis([-0.5 1 -0.5 1])
Write the lines as and . The angles these lines make with the positve x-axis are and , respectively. So the obtuse angle between the lines is . The acute angle between the lines is .
fplot(-1/2*x + 7/2); grid on; hold on
plot(1, 3, 'mo', 'MarkerFaceColor', 'm')
axis equal; axis([-2 2 -2 5])
The acute angle between two curves at their point of intersection is computed.
f(x) = sin(x), g(x) = cos(x)
Df(x) = diff(f(x), x), Dg(x) = diff(g(x), x)
xi = solve(f(x) == g(x), x)
theta = double(rad2deg(atan(mf) - atan(mg))) % angle betwee curves in degrees (approx)
Lf(x) = expand(f(xi) + mf*(x - xi))
Lg(x) = expand(g(xi) + mg*(x - xi))
fplot(f(x), [0 pi/2], 'LineWidth', 2); grid on; hold on
fplot(g(x), [0 pi/2], 'LineWidth', 2); grid on; hold on
fplot(Lf(x), [0 pi/2], 'b--');
fplot(Lg(x), [0 pi/2], 'r--');
plot(P(1), P(2), 'mo', 'MarkerFaceColor', 'm', 'MarkerSize', 10)
axis equal; axis([0 pi/2 0 1.5])
Scalar and vector projections are computed.
a = sym([1 2 3]), b = sym([5 0 -1])
comp_a_b = dot(a,b) / norm(a)
comp_a_b_appx = double(comp_a_b)
proj_a_b = comp_a_b * a/norm(a)
proj_a_b_appx = double(proj_a_b)
A boat sails south with the help of a wind blowing in the direction SE with magnitude 400 lb. Find the work done by the wind as the boat moves 120 ft. Work is the dot product of force with displacement FD.
mag_F = 400; mag_D = 120; theta = 36 % degrees
work = mag_F * mag_D * cosd(36) % work in ft-lb