Understanding Vector Direction
The direction of a vector describes where it points in space. In 2D, direction is specified by a single angle measured from the positive x-axis. In 3D, direction requires more information such as direction cosines, azimuth and elevation angles, or spherical coordinates.
Direction Measurements
Direction Angle (2D)
The angle from the positive x-axis to the vector, measured counter-clockwise. Range: -180 to 180 degrees.
Direction Cosines (3D)
The cosines of the angles between the vector and each coordinate axis. They satisfy cos^2(a) + cos^2(b) + cos^2(g) = 1.
Azimuth
The angle in the xy-plane measured from the positive x-axis. Used in navigation and spherical coordinates.
Elevation
The angle from the xy-plane to the vector. Positive means above the plane, negative means below.
Compass Bearing
Measured clockwise from north (positive y-axis). Common in navigation and surveying.
Polar/Spherical
Polar coordinates use (r, theta) in 2D. Spherical coordinates use (r, theta, phi) in 3D.
Applications
- Navigation: Compass bearings for heading and course calculations.
- Physics: Direction of forces, velocity vectors, electric fields.
- Robotics: Orientation of robot arms, tool direction vectors.
- Astronomy: Azimuth and elevation to locate celestial objects.
- Game Development: Character facing direction, projectile trajectories.
Converting Between Representations
You can convert between Cartesian components, polar/spherical coordinates, and direction cosines. The key relationships are: x = |v| cos(alpha), y = |v| cos(beta), z = |v| cos(gamma). In 2D: x = |v| cos(theta), y = |v| sin(theta).