PHP Classes

Only one set of coordinates being returned

Recommend this page to a friend!

      PHP Circles Intersection  >  All threads  >  Only one set of coordinates being...  >  (Un) Subscribe thread alerts  
Subject:Only one set of coordinates being...
Summary:When circles are vertically aligned only one set is returned
Messages:2
Author:Steve Burgess
Date:2017-04-03 07:18:28
 

  1. Only one set of coordinates being...   Reply   Report abuse  
Picture of Steve Burgess Steve Burgess - 2017-04-03 07:18:28
I have the following circles:

x1=268
y1=350
r1=135

x2=500
y2=350
r2=231

Only one set of intersection coordinates is being returned by the class in the above instance:

Array
(
[0] => Array
(
[x] => 278.48239740821
[y] => 416.5555538027
)

)

  2. Re: Only one set of coordinates being...   Reply   Report abuse  
Picture of Ovunc Tukenmez Ovunc Tukenmez - 2017-10-23 22:36:05 - In reply to message 1 from Steve Burgess
Hello Steve,

First, I'm sorry for my late reply, I didn't notice the forum message.

Thanks for your bug report, I've updated class to fix that issue.

$class1 = new IntersectionPointsOf2Circles(268, 350, 135, 500, 350, 231);
$points = $class1->getPoints();
print_r($points);

/*
Array
(
[0] => Array
(
[x] => 308.27586206897
[y] => 478.85206608589
)

[1] => Array
(
[x] => 308.27586206897
[y] => 221.14793391411
)

)
*/