public final class Circle extends Object
Modifier and Type | Method and Description |
---|---|
static Point2d[] |
getIntersection(Point2d p1,
double r1,
Point2d p2,
double r2)
Returns the intersections of two circles.
|
static Point2d |
getIntersectionApprox(Point2d p1,
double r1,
Point2d p2,
double r2)
Returns an approximated intersection of the two circles.
|
static Point2d[] |
getLineIntersection(Point2d m,
double r,
Point2d p1,
Point2d p2)
Returns the intersection of the given circle and line.
|
static IntersectionPoint2d[] |
minimumCircleContainment(Point2d[] m,
double[] r,
IntersectionPoint2d[] pts,
int min,
boolean useApprox)
Only keeps points which are contained in
min circles or
points which are approximated. |
static boolean |
pointInCircles(Point2d[] m,
double[] r,
Point2d p)
Tests if a given point lies in all circles defined by
m
and r . |
public static Point2d[] getIntersection(Point2d p1, double r1, Point2d p2, double r2)
p1
- The center of the first circle.r1
- The radius of the first circle.p2
- The center of the second circle.r2
- The radius of the second circle.null
if
there is no (exact) intersection.public static Point2d getIntersectionApprox(Point2d p1, double r1, Point2d p2, double r2)
This method might be helpful if the circles are separate or contained within the other. Returns the intersection of the two circles when equally growing both circles till they intersect in one point.
p1
- The center of the first circle.r1
- The radius of the first circle.p2
- The center of the second circle.r2
- The radius of the second circle.null
if p1 equals p2.public static Point2d[] getLineIntersection(Point2d m, double r, Point2d p1, Point2d p2)
There might be two points, one point or no point.
m
- The center of the circle.r
- The radius of the circle.p1
- The first point defining the line.p2
- The second point defining the line.null
if there is no intersection.public static boolean pointInCircles(Point2d[] m, double[] r, Point2d p)
m
and r
.m
- The center of the circles.r
- The radius of the circles.p
- The point to be tested.true
if the given point lies in all circles;
false
otherwise.public static IntersectionPoint2d[] minimumCircleContainment(Point2d[] m, double[] r, IntersectionPoint2d[] pts, int min, boolean useApprox)
min
circles or
points which are approximated.m
- The center of the circles.r
- The radius of the circles.pts
- The points to be tested.min
- The number of minimum contained circles for a point.useApprox
- Also test approximated points?Copyright © 2012 Thomas Hillebrandt. All Rights Reserved.