What exactly is magnitude?

What exactly is magnitude?

I read that:
In mathematics, magnitude or size of a mathematical object is a property which determines whether the object is larger or smaller than other objects of the same kind.

However, if you use the formula for magnitude on a vector3 position in the world, you’ll get a value that varies, how can the ‘size’ of JUST a position vary?

6 Likes

The magnitude in vectors is the distance between the origin and the result.
Basically, in roblox, the origin for vectors is (0, 0, 0).
If you have a vector3 (x, y, z), the magnitude would be sqrt(x ^2, y ^ 2, z ^ 2)

13 Likes

Ah, so it’s distance from the origin, hence why we subtract two positions to get the distance between them?

1 Like

Because when you substract 2 vectors, you are substracting their components

E.g :

local v1 = Vector3.new(6, 8, 2)
local v2 = Vector3.new(8, 2, 1)

local v3 = v1 - v2 -- (-2, 6, 1)

v
An awful drawing that represents it

16 Likes