Circle overlap formula

BlitzMax Forums/BlitzMax Programming/Circle overlap formula

Filax(Posted 2006) [#1]
Hi :)

I need a function to get overlaping between Circle => Circle ?

Any idea :) ?




H&K(Posted 2006) [#2]
((x0-x1)^2+(y0-y1)^2)^0.5 < R0+R1
(ie. if the distance between the two centres is less than the sum of the two radus)

For real circles. DOnt know how relevent to your program


Filax(Posted 2006) [#3]
Many thanks H&K :)


Warpy(Posted 2006) [#4]
by the way, using ^ is rather slow, so use
sqr((x0-x1)*(x0-x1)+(y0-y1)*(y0-y1))


tonyg(Posted 2006) [#5]
You could also try not using sqr or ^0.5 and using
{r0+r1)*(r0+r1)