INTERSECTCIRCLES Intersection points of two circles.

   POINTS = intersectCircles(CIRCLE1, CIRCLE2)
   Computes the intersetion point of the two circles CIRCLE1 and CIRCLE1.
   Both circles are given with format: [XC YC R], with (XC,YC) being the
   coordinates of the center and R being the radius.
   POINTS is a 2-by-2 array, containing coordinate of an intersection
   point on each row. 
   In the case of tangent circles, the intersection is returned twice. It
   can be simplified by using the 'unique' function.

   Example
     % intersection points of two distant circles
     c1 = [0  0 10];
     c2 = [10 0 10];
     pts = intersectCircles(c1, c2)
     pts =
         5   -8.6603
         5    8.6603

     % intersection points of two tangent circles
     c1 = [0  0 10];
     c2 = [20 0 10];
     pts = intersectCircles(c1, c2)
     pts =
         10    0
         10    0
     pts2 = unique(pts, 'rows')
     pts2 = 
         10    0

   References
   http://local.wasp.uwa.edu.au/~pbourke/geometry/2circle/
   http://mathworld.wolfram.com/Circle-CircleIntersection.html

   See also
   circles2d, intersectLineCircle, radicalAxis


 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2011-01-20,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2011 INRA - Cepia Software Platform.

Package: matgeom