Matrices.org

Vector Components Calculator

Calculate the horizontal, vertical and depth components of a vector. Convert magnitude and direction into X, Y and Z components, or enter the components to find the vector's magnitude and direction.

Calculate Vector Components

Choose the calculation you need. Angles are entered in degrees.

The length or size of the vector. Must be zero or positive.
Measured counterclockwise from the positive X-axis.

Vector Components Formulas

2D vector components

For a vector with magnitude r and direction angle θ measured counterclockwise from the positive X-axis:

x = r cos(θ)
y = r sin(θ)

The X component is the horizontal projection. The Y component is the vertical projection. Both components can be positive, negative or zero.

3D vector components

For this calculator, azimuth φ is measured in the XY plane from the positive X-axis, while elevation θ is measured upward from the XY plane:

x = r cos(θ) cos(φ)
y = r cos(θ) sin(φ)
z = r sin(θ)

This convention is important: other textbooks and software may define spherical-coordinate angles differently. Always check how the angles are measured before comparing results.

Magnitude from components

|v| = √(x² + y² + z²)

For a 2D vector, set z = 0. The direction in the XY plane can be found with atan2(y, x), which correctly accounts for the vector's quadrant.

Worked Examples

Example 1: 2D vector with magnitude 10 and angle 30°

Given r = 10 and θ = 30°:

x = 10 cos(30°) ≈ 8.6603
y = 10 sin(30°) = 5

The vector is approximately (8.6603, 5).

Example 2: 3D vector with magnitude 10

Let the azimuth be 45° and elevation be 30°:

x = 10 cos(30°) cos(45°) ≈ 6.1237
y = 10 cos(30°) sin(45°) ≈ 6.1237
z = 10 sin(30°) = 5

The vector is approximately (6.1237, 6.1237, 5).

Example 3: Find magnitude from components

For v = (3, 4, 0):

|v| = √(3² + 4² + 0²) = √25 = 5

The vector has magnitude 5 and an azimuth of approximately 53.1301°.

Understanding Vector Components

A vector describes a quantity with both magnitude and direction. Components express that vector as separate amounts along coordinate axes. In two dimensions, these are usually called the X and Y components. In three dimensions, a Z component is added.

Breaking a vector into components makes many mathematical and physical problems easier. Instead of working with a diagonal vector directly, you can calculate its effect along each axis independently and combine the results when needed.

Why can a component be negative?

The sign indicates direction. A negative X component points partly toward the negative X-axis; a negative Y component points partly toward the negative Y-axis. A negative Z component points downward if positive Z is defined as upward.

Common applications

Frequently Asked Questions

1. How do I find the X component of a vector?

Multiply the vector's magnitude by the cosine of its direction angle: x = r cos(θ), when the angle is measured from the positive X-axis.

2. How do I find the Y component?

Multiply the magnitude by the sine of the direction angle: y = r sin(θ), using the same angle convention.

3. Does the calculator use degrees or radians?

The input fields use degrees. The calculator converts the angles to radians internally for trigonometric calculations.

4. What is azimuth in a 3D vector?

Azimuth is the angle of the vector's horizontal projection in the XY plane, measured here from the positive X-axis toward the positive Y-axis.

5. What is elevation?

Elevation is the angle above or below the XY plane. Positive elevation points upward; negative elevation points downward.

6. Can I enter negative components?

Yes. Negative values are valid and indicate direction along the negative coordinate axis.

7. What happens if the magnitude is zero?

All calculated components are zero. A zero vector has no unique direction, so its direction angles are not mathematically defined.

8. What is the difference between a component and a magnitude?

A component is a signed projection along one axis. Magnitude is the nonnegative length of the entire vector.

Related Matrix and Vector Calculators