Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Magnitude Question?

Asked by
woodengop 1134 Moderation Voter
9 years ago

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?

0
For those who are wondering, I'm not requesting, I just find it Difficult to use the magnitude. woodengop 1134 — 9y

1 answer

Log in to vote
2
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
9 years ago

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

Ad

Answer this question