Calculate max radius within zone
#1

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.
Reply
#2

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)