Ok,
I am trying to make a math library for myself to experiment stuff
so, I came up with a case where you want to find the distance btw 2 points.
Now everyone normally uses this
(p1 - p2).magnitude
Well, I am not great at maths and stuff, so I refer my academic textbooks (ugh)
and here's how I made a distance function
function module.Distance(p1, p2)
return math.sqrt((p1.X - p2.X)^2 + (p1.Y - p2.Y)^2 + (p1.Z - p2.Z)^2)
end
I am wondering which is the best to use.....
=3

3 comments
I'm pretty sure magnitude is more efficient... You don't need to use so much math when you can simply say "magnitude" and it gives you the distance
xd, I am wondering that too xD, but the other is more close to maths so MATHS MATHS MATHS X-X
I would say the formula, not the function.