Simple Linear Algebra with Geometry Nodes

geonodes
Author

ozm

Published

September 20, 2025

Here is an easy way to visualize vector operations with Geometry Nodes.

What Is A Vector?

A vector can be thought of as an arrow, with the following important aspects:
A vector only describes direction and length. It has its tail always at the origin!

A position in 2D or 3D space is a vector: an arrow pointing to the position from the origin.

Visualize A Vector

This can be visualized with Geometry Nodes:

  • Create an empty, this is your position.
  • Create a mesh (e.g. a plance) and create a Geometry Nodes setup on it.
  • Bring in the empty and use its position in a Curve Line node as the end.

Turn on the pin, to keep the node tree visible when moving the empty

We can color the line by storing an attribute, and accessing it again with the Viewer node:

Create a color attribute

Visualize the color

Add Another Vector

Adding another empty as a second vector:

Use a second empty, set same attribute

Do Some Math

Now we can do some math. Use the Vector Math node and a Curve Line to visualize the result:

Do some vector math

Apply several operations and see what happens:

More vector math, set length of vec to 1

The Node Tree

This is the final node setup. Most of it is for visualisation:

What is vis, what is math

Get The Center Point

More vector math: how do we get the center between two positions:

Center point

Subtracting a vector A from B returns a vector pointing from B to A, but with its tail at the origin! Remember, a vector is only direction and length. Wen can not move it in space!

We can then scale the vector by multiplying it (Scale operation in the Vector Math node).

And then move the resulting position by adding vector A:

Subtract, Multiply and Add

So the result is a vector pointing at the center between vector A and B. Move the empties, and the result will update:

The result

Move Along A Vector

When we have a vector, we can move along it by multiplying it with a float. This operation is called Scale in the Vector Math node:

Use scale to move between the two vectors (same as ray equation)

Example Operations: Reflect

What does Reflect do, the result seems wierd:

What does Reflect do? Result is wierd

3D can be hard, so a way to simplify things, is to look at them in 2D (also move the empties so they are on a plane):

Simplify: look at it in 2D

It makes a little more sense. Also try switching the direction of the result by Scaling it with -1:

Makes a little more sense when we switch the direction of the result

Again, simplify by keeping one empty along a world axis:

Again: simplify

Now it is a clear reflection of one vector using the other one as the “mirror”:

Now it is a clear reflection

Example Operations: Projection

Same here, simplify by placing the emtpies on a plane:

Try out projection

The result is the projection of vector A onto B.

Again simplify: use 2D coordinates

Back to top