Interactive vectors sandbox

Vectors are often confusing, so I made this interactive sandbox to help people understand them better!

Vectors are fundamental to game programming. Understanding of them allows for flexible, efficient and clean code. In simple terms, a vector is a list of numbers which can be interpreted as a point in space or a direction.

Basis is a very simple concept.

N-dimensional vectors have N independent values, meaning each one of them has a unique meaning that cannot be described using other dimensions. So for a 2D vector (X, Y), changing X will never affect Y and vice versa.

For an N-dimensional space, be it 2D or 3D for instance, given a “good” (will be explained later) set of “starting” vectors, we can combine them in specific proportions to get all vectors in the N-dimensional space. Take a look at this 2D example:

<BasisLab />

C = 1.0A + 1.0B

Linear Combination Scalars

Scalar (a): 1.0
Scalar (b): 1.0

Transformation Matrix [A | B]

[
]
Det: 1.00
Vector C Result (1.00, 1.00)

This principle is called linear independency, and those values X and Y are called lineraly independent.

<VectorLab />

Pos: (0.00, 0.00) Dist: 0.00
359°
Vector A
X:
Y:
L:
359°
Vector B
X:
Y:
L:
Dot Product: 0.000
Cosine (θ): 0.000
Angle: 0° | 0.000 rad
Pi: 0.00π
A·B = AxBx + AyBy
A·B = |A||B|cosθ

Basis Matrix

A₁
B₁
A₂
B₂

The app was made using Google Gemini.

Built with Hugo
Theme Stack designed by Jimmy