3D vector visualiser: add vectors, dot product as projection, cross product as area, shortest distance between lines

Type two vectors in 3D and turn the picture round to see a + b, the dot product as the shadow of one vector on the other, and the cross product standing square to both with the parallelogram's area. Then put two lines in space and find the angle and the shortest distance between them, with the closest points marked.

Keep it one tap away for everyday use.

Bookmark 3D vector lab?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Type a, b
  2. Turn
  3. a · b, a × b
  4. Distance
Nothing is uploadedWorks offline once open
a = ()
b = ()

Drag the picture to turn it round. The x-axis is red, y green and z grey, pointing up.

Try this

  • a · b: make b square to a, for example a = (1, 0, 0), b = (0, 2, 5). The dot product is 0 and the projection shrinks to nothing.
  • a × b: swap a and b. The cross product flips to point the other way (right-hand rule), with the same length.
  • a × b with b a multiple of a: the parallelogram is flat, so the area and the cross product are 0.
  • Lines in space: make the second direction a multiple of the first. The lines are parallel, and the distance formula changes.

Check yourself

Fresh numbers every time. Type a number or a fraction such as 3/4; nothing is saved or sent.

    What it shows

    A vector in space has three parts, a = (a₁, a₂, a₃), and is drawn as an arrow from the origin. This page draws your vectors in 3D on a picture you can turn with a finger or the mouse, and shows the three things school vector algebra does with them:

    • a + b: put the tail of b on the head of a; the sum goes from the start to the finish.
    • a · b (the dot product): a single number, a₁b₁ + a₂b₂ + a₃b₃ = |a||b| cos θ. It measures how much the vectors point the same way. Divided by |a|, it is the length of b’s shadow (projection) on a, drawn in green.
    • a × b (the cross product): a vector square to both a and b, pointing by the right-hand rule, whose length is the area of the parallelogram they make.

    A fourth view puts two lines in space, r = p₁ + s d₁ and r = p₂ + t d₂, and finds whether they meet, are parallel or are skew, the angle between them and the shortest distance, with the closest points joined in green.

    It follows vector algebra and three-dimensional geometry in Class 12 maths. In two dimensions, the matrix transform page shows how areas scale (the cross product’s 2D cousin, the determinant), the argand plane adds arrows as complex numbers, and the matrix calculator handles bigger matrix work.

    How to use it

    1. Pick a + b, a · b, a × b or Lines in space.
    2. Type the x, y and z parts of a and b (or, for lines, a point p and a direction d for each).
    3. Drag the picture to turn it, or use the buttons for a tilted view, a view from above or from the front.
    4. Read the working line, which fills in your numbers, and the facts below it.

    Formulas used

    • |a| = √(a₁² + a₂² + a₃²); direction cosines (a₁, a₂, a₃)/|a|.
    • a · b = a₁b₁ + a₂b₂ + a₃b₃, cos θ = a · b / (|a||b|), projection of b on a = a · b / |a|.
    • a × b = (a₂b₃ − a₃b₂, a₃b₁ − a₁b₃, a₁b₂ − a₂b₁); area of the parallelogram |a × b|, of the triangle half that.
    • Skew lines: d = |(p₂ − p₁) · (d₁ × d₂)| / |d₁ × d₂|. Parallel lines: d = |(p₂ − p₁) × d₁| / |d₁|.

    Worked example

    With a = (2, 1, −2) and b = (1, 3, 1): a + b = (3, 4, −1); a · b = 2 + 3 − 2 = 3, |a| = 3 and |b| = √11, so cos θ = 3 / (3√11) and θ ≈ 72.45°; the projection of b on a is 3/3 = 1. The cross product is a × b = (7, −4, 5) and the parallelogram’s area is √90 ≈ 9.4868.

    For the lines through (1, 2, 3) along (1, −3, 2) and through (4, 5, 6) along (2, 3, 1), d₁ × d₂ = (−9, 3, 9) and the shortest distance is |(3, 3, 3) · (−9, 3, 9)| / √171 = 9 / 13.077 ≈ 0.6882.

    Check yourself

    Five questions with fresh numbers: a dot product, a length, a part of a cross product, a parallelogram’s area and the angle when a · b = 0. Nothing is saved.

    FAQ

    Why does a × b change sign when I swap a and b? The right-hand rule: curling from b to a instead of a to b points your thumb the other way.

    Is this from my textbook? It covers the standard school topics with its own examples. It is an independent study aid.

    Where the numbers come from

    • Standard vector algebra and three-dimensional geometry: components, magnitude, direction cosines, dot and cross products, projections, the vector equation of a line, the angle between lines and the shortest distance between skew and parallel lines. Written for fibub; no textbook text, figures or exercises are used, and the example vectors are made up.
    • Checked against NumPy (sums, dot and cross products, angles, projections, direction cosines) and against a direct numerical minimisation of the distance between two lines with scipy.optimize.minimize.

    Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

    Read more on the Blog

    Last updated 2026-11-09.

    Change log for 3D vector lab

    1. Add #1190 3D vector lab Details on GitHub

    Every change to fibub

    Related tools

    Matrix calculator #T371 Determinant, inverse, rank and row reduction with every step in exact fractions, solving A x = B, products and powers, eigenvalues and eigenvectors (complex ones too), and LU, QR, Cholesky and SVD decompositions. Checked against numpy and sympy. Argand plane #L90 Drag two complex numbers z and w on the Argand plane and see z + w as a parallelogram, z × w as stretch-and-turn, the conjugate as a reflection, modulus, argument and polar form, powers of i as quarter turns, and the complex roots of a quadratic appearing when the parabola misses the x-axis. Matrix transform #L92 Watch a 2 × 2 matrix move the whole grid: rotations, shears, stretches, reflections and squashes, with the determinant shown as the area scale and the sign as a flip. Do one transformation after another to see why AB ≠ BA, and solve a 3 × 3 system step by step with cofactors, the adjoint and A⁻¹ in exact fractions. Vector adder #L193 Drag two arrows and watch their resultant drawn by the triangle law, the parallelogram law or by components, with its size and direction worked out. Then hang a weight from two strings and see Lami's theorem give each tension. 3D point plotter #L237 Turn a set of x, y and z axes round with your finger, place two points and see the dashed box that shows each coordinate. The octant of each point and the 3D distance formula are worked with your numbers, and the section formula puts a third point between them. Quadratic explorer #L68 Slide a, b and c and watch the parabola move: vertex, roots and the discriminant update live, completing the square is drawn with tiles, and the middle term is split for you. With fresh practice questions.