SA-MP Forums Archive
Calculate max radius within zone - 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: Calculate max radius within zone (/showthread.php?tid=369777)



Calculate max radius within zone - lolumadd_ - 18.08.2012

I have gangzones (minx, miny, maxx, maxy). I want to find the max radius that will cover most of the area using those coords.

Like this:



Does anybody know of the formula to find that radius knowing the coords of the 4 corners?

Thanks.


Re: Calculate max radius within zone - leonardo1434 - 18.08.2012

http://forum.sa-mp.com/showpost.php?...postcount=3315


Re: Calculate max radius within zone - lolumadd_ - 18.08.2012

Not exactly what I was looking for but helpful. I edited the Pythagoras' Theorem to output this:

radius = 0.5 * floatsqroot((maxx-minxx) * (maxx-minxx) + (maxy-miny) * (maxy-miny))

If anyone wants that.