public final class Point2D extends Object implements Serializable
Constructor and Description |
---|
Point2D() |
Point2D(double x,
double y) |
Point2D(Point2D other) |
Modifier and Type | Method and Description |
---|---|
void |
add(Point2D other) |
void |
add(Point2D p1,
Point2D p2) |
int |
compare(Point2D other)
Compares two vertices lexicographically by y.
|
static int |
compareVectors(Point2D v1,
Point2D v2)
Assume vector v1 and v2 have same origin.
|
static Point2D |
construct(double x,
double y) |
double |
crossProduct(Point2D other) |
static double |
distance(Point2D pt1,
Point2D pt2) |
double |
dotProduct(Point2D other) |
boolean |
equals(Object other) |
boolean |
equals(Point2D other) |
int |
getQuarter()
Calculates which quarter of XY plane the vector lies in.
|
int |
hashCode() |
void |
interpolate(Point2D other,
double alpha) |
void |
interpolate(Point2D p1,
Point2D p2,
double alpha) |
boolean |
isEqual(double x_,
double y_) |
boolean |
isEqual(Point2D other) |
boolean |
isEqual(Point2D other,
double tol) |
boolean |
isNaN() |
void |
leftPerpendicular()
90 degree rotation, anticlockwise.
|
void |
leftPerpendicular(Point2D pt)
90 degree rotation, anticlockwise.
|
double |
length() |
void |
negate() |
void |
negate(Point2D other) |
void |
normalize() |
void |
normalize(Point2D other) |
static int |
orientationRobust(Point2D p,
Point2D q,
Point2D r)
Calculates the orientation of the triangle formed by p, q, r.
|
void |
rightPerpendicular()
270 degree rotation, anticlockwise.
|
void |
rightPerpendicular(Point2D pt)
270 degree rotation, anticlockwise.
|
void |
rotateDirect(double Cos,
double Sin) |
void |
rotateReverse(double Cos,
double Sin) |
void |
scale(double f) |
void |
scale(double f,
Point2D other) |
void |
scaleAdd(double f,
Point2D shift)
Calculates this = this * f + shift
|
void |
scaleAdd(double f,
Point2D other,
Point2D shift)
Calculates this = other * f + shift
|
void |
setCoords(double x,
double y) |
void |
setCoords(Point2D other) |
void |
setNaN() |
static double |
sqrDistance(Point2D pt1,
Point2D pt2) |
double |
sqrLength() |
void |
sub(Point2D other) |
void |
sub(Point2D p1,
Point2D p2) |
String |
toString() |
public Point2D()
public Point2D(double x, double y)
public Point2D(Point2D other)
public static Point2D construct(double x, double y)
public void setCoords(double x, double y)
public void setCoords(Point2D other)
public boolean isEqual(Point2D other)
public boolean isEqual(double x_, double y_)
public boolean isEqual(Point2D other, double tol)
public boolean equals(Point2D other)
public void sub(Point2D other)
public void add(Point2D other)
public void negate()
public void negate(Point2D other)
public void interpolate(Point2D other, double alpha)
public void scaleAdd(double f, Point2D shift)
f
- shift
- public void scaleAdd(double f, Point2D other, Point2D shift)
f
- other
- shift
- public void scale(double f, Point2D other)
public void scale(double f)
public int compare(Point2D other)
public void normalize(Point2D other)
public void normalize()
public double length()
public double sqrLength()
public double dotProduct(Point2D other)
public double crossProduct(Point2D other)
public void rotateDirect(double Cos, double Sin)
public void rotateReverse(double Cos, double Sin)
public void leftPerpendicular()
public void leftPerpendicular(Point2D pt)
public void rightPerpendicular()
public void rightPerpendicular(Point2D pt)
public int getQuarter()
public static int compareVectors(Point2D v1, Point2D v2)
public void setNaN()
public boolean isNaN()
public static int orientationRobust(Point2D p, Point2D q, Point2D r)
Copyright © 2018. All rights reserved.