| Modifier and Type | Field and Description |
|---|---|
Comparator<Point2D> |
Point2D.ATAN2_ORDER
Compares two points by atan2() angle (between -pi and pi) with respect to this point.
|
Comparator<Point2D> |
Point2D.DISTANCE_TO_ORDER
Compares two points by distance to this point.
|
Comparator<Point2D> |
Point2D.POLAR_ORDER
Compares two points by polar angle (between 0 and 2pi) with respect to this point.
|
static Comparator<Point2D> |
Point2D.R_ORDER
Compares two points by polar radius.
|
static Comparator<Point2D> |
Point2D.X_ORDER
Compares two points by x-coordinate.
|
static Comparator<Point2D> |
Point2D.Y_ORDER
Compares two points by y-coordinate.
|
| Modifier and Type | Method and Description |
|---|---|
Point2D |
ClosestPair.either() |
Point2D |
FarthestPair.either() |
Point2D |
ClosestPair.other() |
Point2D |
FarthestPair.other() |
| Modifier and Type | Method and Description |
|---|---|
Iterable<Point2D> |
GrahamScan.hull() |
| Modifier and Type | Method and Description |
|---|---|
static double |
Point2D.area2(Point2D a,
Point2D b,
Point2D c)
Returns twice the signed area of the triangle a-b-c.
|
static int |
Point2D.ccw(Point2D a,
Point2D b,
Point2D c)
Is a->b->c a counterclockwise turn?
|
int |
Point2D.compareTo(Point2D that)
Compares this point to that point by y-coordinate, breaking ties by x-coordinate.
|
boolean |
Interval2D.contains(Point2D p)
Does this two-dimensional interval contain the point p?
|
double |
Point2D.distanceSquaredTo(Point2D that)
Returns the square of the Euclidean distance between this point and that point.
|
double |
Point2D.distanceTo(Point2D that)
Returns the Euclidean distance between this point and that point.
|
void |
Point2D.drawTo(Point2D that)
Plot a line from this point to that point using standard draw.
|
| Constructor and Description |
|---|
ClosestPair(Point2D[] points) |
FarthestPair(Point2D[] points) |
GrahamScan(Point2D[] pts) |
Copyright © 2014. All Rights Reserved.