public class SmallestEnclosingCircle
extends Object
Constructor and Description |
---|
SmallestEnclosingCircle() |
Modifier and Type | Method and Description |
---|---|
static double |
angle(Point a,
Point b,
Point c)
Computes the angle ABC from the points a, b, c.
|
static ArrayList<Point> |
convexHull(ArrayList<Point> points)
Given a set of points, returns the set of points in the convex hull in
counterclockwise order.
|
static int |
crossProduct(Point o,
Point a,
Point b)
Performs a 2D cross product of OA and OB vectors.
|
static double |
dotProduct(Point a,
Point b,
Point c)
Computes the dot product of the vectors ba, bc from the points a, b, c.
|
static Point |
getCenterPoint(HashSet<Point> pointsSet)
Returns a new point which is the center of the smallest enclosing circle
on points.
|
static Point |
getCircumcenter(Point a,
Point b,
Point c)
Determines the circumcenter of a circle that circumscribes triangle abc.
|
static void |
main(String[] args)
Command line interface for debug.
|
static void |
printPoints(HashSet<Point> points) |
public static Point getCenterPoint(HashSet<Point> pointsSet)
pointsSet
- the points in the set to consider.public static ArrayList<Point> convexHull(ArrayList<Point> points)
points
- the input set of pointspublic static Point getCircumcenter(Point a, Point b, Point c)
a
- Point A of the triangleb
- Point B of the trianglec
- Point C of the trianglepublic static int crossProduct(Point o, Point a, Point b)
o
- Point Oa
- Point Ab
- Point Bpublic static void printPoints(HashSet<Point> points)
public static double angle(Point a, Point b, Point c)
a
- Point Ab
- Point Bc
- Point Cpublic static double dotProduct(Point a, Point b, Point c)
a
- Point Ab
- Point Bc
- Point Cpublic static void main(String[] args)
args
- No args defined for this main()