Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Magnitude Question?

The Magnitude term is quite confusing, So far i've been testing the magnitude and I'm planning on making a Radar, How would I find the magnitude between Player 2's Torso and Player 1's torso?

1 comment

0

For those who are wondering, I'm not requesting, I just find it Difficult to use the magnitude.

1 answer

✓ Accepted answer

Magnitude is the size or length of a vector. It's also called norm by math.

In geometry, a vector is a distance (a magnitude) in a direction. The displacement (difference in position) between points A and B is a vector. It can be computed by subtracting their positions: To get from A, you add the vector B - A: A + (B - A) = B.

Thus the distance between A and B is the magnitude of that displacement. In Lua, if x and y are two different parts, the distance between their centers will be

(x.Position - y.Position).magnitude

This discussion is preserved as it was. New answers, comments, and votes are closed.