3D Vector Direction Angle Calculator
Enter one nonzero 3D vector to find its three axis direction angles and direction cosines.
Enter vector components
Your data stays in this browser.
Result
Enter the components, then select Calculate.
- Magnitude |v|
- Direction cosines
- Angle α with the positive x-axis
- Angle β with the positive y-axis
- Angle γ with the positive z-axis
How to use the vector direction angle calculator
This calculator describes one 3D vector relative to the positive coordinate axes. These are three axis angles—not the angle between two vectors and not a 2D bearing.
- Enter the x, y, and z components of vector v.
- Select Calculate. The vector must be nonzero.
- Read the magnitude and direction cosines l, m, and n.
- Read α, β, and γ, the angles with the positive x-, y-, and z-axes, in degrees and radians.
- Copy the results or select Clear to begin with empty fields.
Direction cosines and axis angles
For v = (x,y,z) with magnitude |v| = √(x²+y²+z²), the direction cosines are l = x/|v|, m = y/|v|, and n = z/|v|. They are also the components of the unit vector pointing in the same direction.
The direction angles are α = arccos(l), β = arccos(m), and γ = arccos(n). Each is measured from its positive axis and lies from 0° through 180°. A negative component therefore produces an obtuse angle with that positive axis.
Checks and interpretation
Valid direction cosines satisfy l² + m² + n² = 1, apart from tiny floating-point error. The calculator derives all three from the same magnitude, so their signs retain the original vector’s octant.
These three angles are not independent rotation controls or Euler angles. They describe the orientation of one line from the origin. Multiplying the vector by a positive scalar keeps the angles; multiplying by a negative scalar reverses the direction and replaces each angle θ with 180° − θ.
Uses, limits, and common mistakes
- Describe a 3D force, velocity, line, or normal relative to the coordinate axes.
- Use the cosines as the components of the corresponding unit direction vector.
- Do not confuse α, β, and γ with the single angle between two vectors; this page accepts only one vector.
- The zero vector is rejected because it has magnitude zero and no direction to compare with any axis.
- This page does not calculate azimuth/elevation, coordinate conversion, Euler rotations, or a 3D scene. Results display at most two decimals.
Worked examples
v = (1,1,1): |v| = √3, each direction cosine is about 0.58, and α = β = γ ≈ 54.74° (0.96 rad).
v = (−2,0,0): the direction cosines are (−1,0,0); the axis angles are 180°, 90°, and 90°.
v = (0,0,0): magnitude is zero, so no direction cosine or direction angle is defined.
Frequently asked questions
Are these angles measured between two vectors?
No. Each angle compares one vector with one positive coordinate axis.
Why can a direction angle exceed 90°?
A negative component points partly against that positive axis, so its cosine is negative and its angle is obtuse.
Do the direction cosines form a unit vector?
Yes. The tuple (l,m,n) is the normalized vector and its squared components sum to 1.
Why is the zero vector not allowed?
Dividing its components by magnitude would divide by zero, and the zero vector has no direction.
Does changing the vector length change the angles?
Multiplying by a positive scale does not. Only the direction and component ratios matter.