---
title: Remembering basic math concepts
url: "https://aalegre.net/docs/programming/algebra/remembering-basic-math-concepts/"
updated: "2025-08-26"
category: Programming in Space
---

# Remembering basic math concepts

## 1.- Position or vector?

¿What is the difference between a point and a vector?

In strict math, both are the same. But when using them in practical applications, I like to distinguish between them as such:

**Position:**

In 3D has 3 coordinates. A single point in space

 ![](https://aalegre.net/wp-content/uploads/2024/09/Point-Equation-300x51.png)

**Vector:**

In 3D has 3 coordinates. Direction with scale/magnitude

 ![](https://aalegre.net/wp-content/uploads/2024/09/Vector-equation-300x50.png) Interactive graphic

### 1.1.- Common operations & properties

#### 1.1.1.- Magnitude

The length of the vector

 ![](https://aalegre.net/wp-content/uploads/2024/09/Vector-magnitude-300x53.png)

We apply the Pythagoras theorem

 ![](https://aalegre.net/wp-content/uploads/2024/09/Pythagoras-theorem-300x48.png)

#### 1.1.2.- Unit Vector

A vector with length 1

 ![](https://aalegre.net/wp-content/uploads/2024/09/Unit-Vector-300x136.png)

All divisions can be represented as a multiplication

 ![](https://aalegre.net/wp-content/uploads/2024/09/Regular-vector-to-Unit-Vector-300x93.png)

#### 1.1.3.- Multiplication

Scales the magnitude of the vector

 ![](https://aalegre.net/wp-content/uploads/2024/09/Vector-multiplication-300x144.png) Interactive graphic

#### 1.1.4.- Addition

Moves the vector

 ![](https://aalegre.net/wp-content/uploads/2024/09/Vector-addition-300x136.png) Interactive graphic

###### **Exercise** – Moving a point through space

What is this operation?

   ![](https://aalegre.net/wp-content/uploads/2024/09/Equations-moving-a-point-through-space-300x223.png)   ![](https://aalegre.net/wp-content/uploads/2024/09/Unity-C-code-moving-a-point-through-space.png)

### 1.2.- Other operations

#### 1.2.1.- Dot product

The cosine of the angle in-between two vectors (Also used for alignment)

 ![](https://aalegre.net/wp-content/uploads/2024/09/Dot-Product-300x32.png) Interactive graphic

###### **Exercise** – What I am looking at?

Given a camera, and a group of points, determine the one nearest to the center of the viewport.

   ![](https://aalegre.net/wp-content/uploads/2024/09/What-I-am-looking-at.gif)   ![](https://aalegre.net/wp-content/uploads/2024/09/Code-for-detecting-what-I-am-looking-at.png)

#### 1.2.2.- Cross product

Perpendicular vector with scale related to the area between the two vectors

 ![](https://aalegre.net/wp-content/uploads/2024/09/Cross-Product-300x26.png) Interactive graphic

###### **Exercise** – What is the slope?

The engine gives you three points of collision, and you need to apply a bounce. Find the triangle and it’s normal vector.

   ![](https://aalegre.net/wp-content/uploads/2024/09/Three-points-its-normal-257x300.gif)   ![](https://aalegre.net/wp-content/uploads/2024/09/Three-points-its-normal-C-code.png)

## 2.- The magic hand

Using our own hand, we have a “cheatsheet” of some basic axis

Regular

 ![](https://aalegre.net/wp-content/uploads/2024/09/Magic-Hand-Regular-1024x927.png)

**Unity**

 ![](https://aalegre.net/wp-content/uploads/2024/09/Magic-Hand-Unity-1024x927.png)

Cross product

 ![](https://aalegre.net/wp-content/uploads/2024/09/Magic-Hand-Cross-Product-1024x927.png)

## 3.- Delta Time

 ![](https://aalegre.net/wp-content/uploads/2024/09/Delta-Time-graphic.png) Interactive graphic

## 4.- Lines

## 5.- Planes
