SA-MP Forums Archive
Quick question - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Quick question (/showthread.php?tid=133406)



Quick question - kazuki - 12.03.2010

Hmmm i've been looking at certain distance checking functions, and cant figure out why the coord's are squard, can anyone help me understand thing (yes, i do know about the native function to check distance... this thread isnt a "how do i" thread... its more of a "why?").

ere's an example

Код:
#define PlayerToPoint(%0,%1,%2,%3,%4,%5,%6) \
(((%0 - %3) * (%0 - %3)) + ((%1 - %4) * (%1 - %4)) + ((%2 - %5) * (%2 - %5)) <= %6 * %6)
(x1 - x2)*(x1 - x2)

why is that squared ? can someone help me understand this function more ?



Re: Quick question - kazuki - 12.03.2010

bump ?


Re: Quick question - Babul - 13.03.2010

http://mathworld.wolfram.com/RightTriangle.html