LINEAR ALGEBRA & 3D SPATIAL VECTORS Real-Time 3D Projection • Basis Vector Mapping

3D Vector Transformer

Multiply any 3D coordinate vector by a 3×3 linear transformation matrix in real time. Orbit through an interactive 3D spatial canvas to inspect transformed vectors, basis vector mappings, volume determinant scaling, and angle deflections with full developer exports.

LINEAR ALGEBRA 3D det(A) = 1.0 (Orientation Preserved)

Interactive 3D Vector & 3×3 Matrix Transformer

TRANSFORMATION MATRIX PRESETS:
Row × Column entries
a₁₁
a₁₂
a₁₃
a₂₁
a₂₂
a₂₃
a₃₁
a₃₂
a₃₃
|v| = 3.74
x-component
y-component
z-component
TRANSFORMED VECTOR v' = A · v |v'| = 3.74
v' = (2.00, 3.00, 1.00)ᵀ
Scale: ×1.000 Angle θ: 0.0° v · v' = 14.0
3D SPATIAL VECTOR VIEWPORT
Click & Drag to Orbit 3D • Scroll to Zoom
Input Vector v Transformed v' = Av Parallelepiped
Basis: +X (Red), +Y (Green), +Z (Blue)

123 Step-by-Step Row × Vector Dot Products

Matrix-Vector Multiplication Algorithm
ROW 1 • x' COMPONENT [a₁₁, a₁₂, a₁₃] · v
ROW 2 • y' COMPONENT [a₂₁, a₂₂, a₂₃] · v
ROW 3 • z' COMPONENT [a₃₁, a₃₂, a₃₃] · v
EXPORT TRANSFORMATION IN CODE:
# Python NumPy 3D Vector Transformation
Direct Answer & Overview
Verified Educational Guide

How to Multiply a 3×3 Matrix by a 3D Vector

To multiply a 3×3 matrix A by a 3D column vector v = (x, y, z)ᵀ, compute the inner dot product of each matrix row with the vector. The transformed x' coordinate is Row 1 · v = a₁₁x + a₁₂y + a₁₃z; the transformed y' coordinate is Row 2 · v = a₂₁x + a₂₂y + a₂₃z; and the transformed z' coordinate is Row 3 · v = a₃₁x + a₃₂y + a₃₃z. The resulting vector v' represents the transformed position in 3D Euclidean space.

3D MATRIX-VECTOR MULTIPLICATION FORMULA GL(3, ℝ) Operator
(x′y′z′)=(a11a12a13a21a22a23a31a32a33)(xyz)=(a11x+a12y+a13za21x+a22y+a23za31x+a32y+a33z)\begin{pmatrix} x' \\ y' \\ z' \end{pmatrix} = \begin{pmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{pmatrix} \begin{pmatrix} x \\ y \\ z \end{pmatrix} = \begin{pmatrix} a_{11}x + a_{12}y + a_{13}z \\ a_{21}x + a_{22}y + a_{23}z \\ a_{31}x + a_{32}y + a_{33}z \end{pmatrix}
Each output component is the scalar dot product of a matrix row and the coordinate vector
STEP 1: ROW 1 • x' COMPONENT

Dot product of Row 1 and vector v: x' = a₁₁x + a₁₂y + a₁₃z. Determines new horizontal coordinate.

STEP 2: ROW 2 • y' COMPONENT

Dot product of Row 2 and vector v: y' = a₂₁x + a₂₂y + a₂₃z. Determines new vertical coordinate.

STEP 3: ROW 3 • z' COMPONENT

Dot product of Row 3 and vector v: z' = a₃₁x + a₃₂y + a₃₃z. Determines new depth coordinate.

∞ Linear Mapping Invariant: A(αu + βv) = αAu + βAv and A · 0 = 0. Grid lines remain parallel and evenly spaced, and the origin is strictly fixed.
Input Parameters
Required
1
3×3 Matrix Entries a₁₁ through a₃₃ (Transformation Operator)
2
3D Coordinate Vector v = (x, y, z)ᵀ (Input Vector)
Expected Outputs
Calculated
Transformed 3D Vector v' = (x', y', z')ᵀ
Vector Magnitude Scaling Ratio |v'| / |v|
Angular Deflection θ = arccos((v · v') / (|v| |v'|))
3D Spatial Determinant det(A) Volume Scale Factor
Worked Numerical Example
Instant Verification
Multiply matrix A = [[0, -1, 0], [1, 0, 0], [0, 0, 1]] by vector v = (2, 3, 1)ᵀ
→ x' = (0)(2) + (-1)(3) + (0)(1) = -3 | y' = (1)(2) + (0)(3) + (0)(1) = 2 | z' = (0)(2) + (0)(3) + (1)(1) = 1
v' = (-3, 2, 1)ᵀ (90° counterclockwise rotation around Z-axis, |v'| = |v| = 3.742)

1. Geometric Foundations of 3D Linear Transformations

In three-dimensional Euclidean space (ℝ³), every vector v can be expressed as a linear combination of the three fundamental unit basis vectors:

i = (1, 0, 0)∼,   j = (0, 1, 0)∼,   k = (0, 0, 1)∼

When a linear transformation represented by a 3×3 matrix A acts on space, the principle of linearity ensures that how any arbitrary vector transforms is completely determined by how these three basis vectors transform:

v' = A · v = A(x·i + y·j + z·k) = x(A·i) + y(A·j) + z(A·k) = x·i' + y·j' + z·k'

This reveals a profound geometric insight: the three columns of matrix A are precisely the transformed coordinates of the basis vectors i', j', and k'. If you want to construct a matrix that performs any desired spatial transformation, simply determine where the unit axes land and place their coordinates into the columns of A.

2. The Determinant as a 3D Volume Scale Factor and Chirality Test

The determinant of a 3×3 matrix A, denoted det(A), is defined as:

det(A) = a₁₁(a₂₂a₃₃ − a₂₃a₃₂) − a₁₂(a₂₁a₃₃ − a₂₃a₃₁) + a₁₃(a₂₁a₃₂ − a₂₂a₃₁)

Geometrically, the absolute value |det(A)| represents the scalar volume distortion factor of 3D space:

  • Unit Parallelepiped Volume: The standard unit cube spanned by i, j, k has volume 1. Under transformation A, this cube deforms into a 3D parallelepiped spanned by i', j', k' whose physical volume is exactly |det(A)|.
  • Isochoric Transformations (det = 1): Pure 3D rotations and shears preserve volume identically.
  • Singular Collapse (det = 0): The matrix has rank ≤ 2 and flattens all of 3D space onto a 2D plane, a 1D line, or the origin. Such transformations lose depth information and cannot be inverted.
  • Chirality & Orientation (det < 0): A negative determinant indicates that space has undergone a reflection, inverting the right-hand rule into a left-handed coordinate frame. In 3D rendering engines, this requires flipping polygon triangle winding orders to avoid backface culling errors.

3. Elementary 3D Transformation Archetypes

3D Euler Rotations

Rotations around coordinate axes leave that axis fixed. Rotation around the Z-axis (yaw) rotates the XY plane by angle θ: R_z(θ) = [[cos θ, −sin θ, 0], [sin θ, cos θ, 0], [0, 0, 1]]. All rotations are orthogonal (R∼ · R = I) and have det(R) = 1.

3D Anisotropic Scaling

Diagonal matrices S = diag(s_x, s_y, s_z) scale coordinates independently along axes. The transformed vector is (s_x·x, s_y·y, s_z·z)∼, and the volume scales by s_x · s_y · s_z.

3D Shearing Transformations

Shear matrices displace coordinates proportionally to another axis. For example, shearing X by Z: x' = x + k·z, y' = y, z' = z. Because all diagonal entries are 1 and off-diagonals are triangular, det(A) = 1 (strictly volume-preserving).

Orthogonal Planar Projections

Setting any diagonal entry to zero (e.g. diag(1, 1, 0)) projects vectors orthogonally onto the XY plane (z' = 0). This drops dimensionality from 3D to 2D, producing det = 0 and an uninvertible transformation.

4. Real-World Applications of 3D Vector Transformations

Computer Graphics & GPU Vertex Shaders

Modern GPUs execute 3×3 and 4×4 matrix-vector multiplications billions of times per second. Vertex shaders transform 3D vertex positions and normal vectors from object-local space into world space, camera view space, and clip space.

Aerospace Attitude Dynamics & Flight Navigation

Aircraft and spacecraft navigation systems transform acceleration and angular velocity vectors measured by onboard IMUs (Inertial Measurement Units) from the body-fixed coordinate frame to the Earth-centered inertial (ECI) frame using 3×3 Direction Cosine Matrices (DCM).

Robotics Forward & Inverse Kinematics

Robotic arms consist of links connected by revolute or prismatic joints. Kinematic chains chain 3D rotation and translation matrices (Denavit-Hartenberg parameters) to determine the exact end-effector position and gripper orientation in Cartesian workspace.

Continuum Mechanics & Cauchy Stress Tensors

In civil and mechanical structural engineering, the 3D state of internal stress within a loaded material is represented by a symmetric 3×3 Cauchy stress tensor σ. Multiplying σ by a surface normal vector n yields the traction vector T = σ · n acting across that internal plane.

5. Common Pitfalls to Avoid

PITFALL 1: Row-Major vs. Column-Major Memory Order

Mathematical textbooks and NumPy use row-major notation with column vectors: v' = A · v. In contrast, OpenGL and Three.js matrices in memory are stored in column-major order. In DirectX and some shader languages, vectors are row vectors multiplied from the left: v' = v · A. Transposing the matrix is required when translating between conventions.

PITFALL 2: Non-Commutativity of 3D Rotations

Unlike 2D rotations (which always commute: R(θ)R(φ) = R(φ)R(θ)), 3D rotations about distinct axes do NOT commute: R_x · R_y ≠ R_y · R_x. Multiplying rotational transformation matrices in the wrong sequence will yield completely incorrect 3D spatial orientations.

PITFALL 3: Transforming Surface Normal Vectors Directly with Matrix A

When geometry undergoes non-uniform scaling or shearing, normal vectors must NOT be multiplied by A. Instead, surface normal vectors must be transformed by the inverse transpose matrix: n' = (A−¹)∼ · n. Multiplying normals directly by A causes surface lighting calculations to distort incorrectly.

Frequently Asked Questions

How do you multiply a 3×3 matrix by a 3D vector?
Matrix-vector multiplication computes each component of the transformed output vector via the dot product of a matrix row with the input column vector. Specifically, x' is the dot product of Row 1 and vector v (a₁₁x + a₁₂y + a₁₃z), y' is the dot product of Row 2 and v (a₂₁x + a₂₂y + a₂₃z), and z' is the dot product of Row 3 and v (a₃₁x + a₃₂y + a₃₃z).
What do the three columns of a 3×3 transformation matrix represent geometrically?
The columns of a 3×3 transformation matrix represent the exact coordinates where the three standard unit basis vectors land after transformation. Column 1 [a₁₁, a₂₁, a₃₁]ᵀ is the transformed x-basis vector i' = A · [1, 0, 0]ᵀ. Column 2 [a₁₂, a₂₂, a₃₂]ᵀ is the transformed y-basis vector j' = A · [0, 1, 0]ᵀ. Column 3 [a₁₃, a₂₃, a₃₃]ᵀ is the transformed z-basis vector k' = A · [0, 0, 1]ᵀ.
What does the determinant det(A) tell you about a 3D transformation?
The determinant det(A) represents the factor by which the transformation scales 3D volume. If det(A) = 2, any solid body or parallelepiped doubles in volume. If det(A) = 1, the transformation is volume-preserving (isochoric, like pure rotations and shears). If det(A) < 0, the spatial orientation (chirality) has been inverted from right-handed to left-handed (a reflection occurred). If det(A) = 0, the matrix collapses 3D space onto a 2D plane, 1D line, or single point.
How do you calculate the angle between the original vector v and transformed vector v'?
The angle θ between v and v' is calculated using the Euclidean dot product formula: cos(θ) = (v · v') / (|v| · |v'|), where v · v' = xx' + yy' + zz', and |v| = √(x² + y² + z²) is the vector Euclidean length. Taking the arccosine gives the angular deflection: θ = arccos(cos(θ)) in radians or degrees.
Can a 3×3 matrix translate (move) a 3D vector or point?
No. A 3×3 matrix can only represent linear transformations that keep the origin (0, 0, 0) fixed, because A · [0, 0, 0]ᵀ = [0, 0, 0]ᵀ. Translation shifts the origin and is an affine transformation. To combine 3D translation with rotation and scaling in graphics APIs, developers use 4×4 homogeneous matrices with 4D vectors [x, y, z, 1]ᵀ.
What is an orthogonal 3D matrix?
An orthogonal 3D matrix satisfies Aᵀ · A = I (its transpose is its inverse). Orthogonal matrices represent rigid isometries—pure rotations and reflections—that preserve vector lengths (|Av| = |v|) and maintain all mutual angles between vectors (dot products remain invariant). In orthogonal matrices, det(A) = +1 (proper rotation) or -1 (rotation with reflection).
Why does the order of 3D rotations matter (non-commutativity)?
In 3D space, rotations about different axes do not commute: R_z(θ) · R_x(ϕ) ≠ R_x(ϕ) · R_z(θ). The physical orientation resulting from yawing then pitching is entirely different from pitching then yawing. Matrix multiplication preserves this physical reality because matrix products are strictly non-commutative (AB ≠ BA).