SA-MP Forums Archive
How Can I Get The Coordinates Of The Middle Of An Area - 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)
+--- Thread: How Can I Get The Coordinates Of The Middle Of An Area (/showthread.php?tid=631014)



How Can I Get The Coordinates Of The Middle Of An Area - Novacaine - 21.03.2017

Hi everyone,

I need to find an areas middle point. E.g the areas min-max x-y coordinates are (1234.00, 2468.00, 1579.00, 3692.00). How can i find the middle point of this area?


Re: How Can I Get The Coordinates Of The Middle Of An Area - Toroi - 21.03.2017

(max x - min x) / 2 + min x = mid x
(max y - min y) / 2 + min y = mid y

If my math is not wrong, but I never went to school so i'd bet its wrong


Re: How Can I Get The Coordinates Of The Middle Of An Area - SyS - 21.03.2017

May be use mid point forumula?
(x2-x1/2,y2-y1/2,z2-z1/2)


Re: How Can I Get The Coordinates Of The Middle Of An Area - Novacaine - 21.03.2017

Quote:
Originally Posted by Troydere
Посмотреть сообщение
(max x - min x) / 2 + min x = mid x
(max y - min y) / 2 + min y = mid y

If my math is not wrong, but I never went to school so i'd bet its wrong
Never? Got to be kidding Anyway, I'm gonna try it out. Thanks