Package com.esri.core.geometry
Class Point2D
java.lang.Object
com.esri.core.geometry.Point2D
- All Implemented Interfaces:
Serializable
Basic 2D point class. Contains only two double fields.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static final int
_compareVectors
(Point2D v1, Point2D v2) (package private) double
_dotProductAbs
(Point2D other) (package private) final int
(package private) boolean
_isNan()
(package private) double
_norm
(int metric) (package private) void
_setNan()
void
void
private static Point2D
calculateCenterFromThreePointsHelper_
(Point2D from, Point2D mid_point, Point2D to) private static Point2D
calculateCenterFromThreePointsHelperMP_
(Point2D from, Point2D mid_point, Point2D to) (package private) static Point2D
calculateCircleCenterFromThreePoints
(Point2D from, Point2D mid_point, Point2D to) int
Compares two vertices lexicographically by y.static int
compareVectors
(Point2D v1, Point2D v2) Assume vector v1 and v2 have same origin.(package private) int
Compares two vertices lexicographically by x.static Point2D
construct
(double x, double y) double
crossProduct
(Point2D other) static double
double
dotProduct
(Point2D other) boolean
boolean
(package private) double
getAxis
(int ordinate) int
Calculates which quarter of XY plane the vector lies in.int
hashCode()
(package private) static int
inCircleRobust
(Point2D p, Point2D q, Point2D r, Point2D s) Calculates if the point s is inside of the circumcircle inscribed by the clockwise oriented triangle p-q-r.private static int
inCircleRobustMP_
(Point2D p, Point2D q, Point2D r, Point2D s) void
interpolate
(Point2D other, double alpha) void
interpolate
(Point2D p1, Point2D p2, double alpha) boolean
isEqual
(double x_, double y_) boolean
boolean
boolean
isNaN()
void
90 degree rotation, anticlockwise.void
90 degree rotation, anticlockwise.double
length()
void
negate()
void
void
void
(package private) double
returns signed distance of point from infinite line represented by pt_1...pt_2.static int
orientationRobust
(Point2D p, Point2D q, Point2D r) Calculates the orientation of the triangle formed by p, q, r.void
270 degree rotation, anticlockwise.void
270 degree rotation, anticlockwise.void
rotateDirect
(double Cos, double Sin) void
rotateReverse
(double Cos, double Sin) void
scale
(double f) void
void
Calculates this = this * f + shiftvoid
Calculates this = other * f + shiftvoid
setCoords
(double x, double y) void
void
setNaN()
static double
sqrDistance
(Point2D pt1, Point2D pt2) double
void
void
toString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
x
public double x -
y
public double y
-
-
Constructor Details
-
Point2D
public Point2D() -
Point2D
public Point2D(double x, double y) -
Point2D
-
-
Method Details
-
construct
-
setCoords
public void setCoords(double x, double y) -
setCoords
-
isEqual
-
isEqual
public boolean isEqual(double x_, double y_) -
isEqual
-
equals
-
equals
-
hashCode
public int hashCode() -
sub
-
sub
-
add
-
add
-
negate
public void negate() -
negate
-
interpolate
-
interpolate
-
scaleAdd
Calculates this = this * f + shift- Parameters:
f
-shift
-
-
scaleAdd
Calculates this = other * f + shift- Parameters:
f
-other
-shift
-
-
scale
-
scale
public void scale(double f) -
compare
Compares two vertices lexicographically by y. -
compareX
Compares two vertices lexicographically by x. -
normalize
-
normalize
public void normalize() -
length
public double length() -
sqrLength
public double sqrLength() -
distance
-
dotProduct
-
_dotProductAbs
-
crossProduct
-
rotateDirect
public void rotateDirect(double Cos, double Sin) -
rotateReverse
public void rotateReverse(double Cos, double Sin) -
leftPerpendicular
public void leftPerpendicular()90 degree rotation, anticlockwise. Equivalent to RotateDirect(cos(pi/2), sin(pi/2)). -
leftPerpendicular
90 degree rotation, anticlockwise. Equivalent to RotateDirect(cos(pi/2), sin(pi/2)). -
rightPerpendicular
public void rightPerpendicular()270 degree rotation, anticlockwise. Equivalent to RotateDirect(-cos(pi/2), sin(-pi/2)). -
rightPerpendicular
270 degree rotation, anticlockwise. Equivalent to RotateDirect(-cos(pi/2), sin(-pi/2)). -
_setNan
void _setNan() -
_isNan
boolean _isNan() -
_getQuarter
final int _getQuarter() -
getQuarter
public int getQuarter()Calculates which quarter of XY plane the vector lies in. First quarter is between vectors (1,0) and (0, 1), second between (0, 1) and (-1, 0), etc. The quarters are numbered counterclockwise. Angle intervals corresponding to quarters: 1 : [0 : 90); 2 : [90 : 180); 3 : [180 : 270); 4 : [270 : 360) -
_compareVectors
-
compareVectors
Assume vector v1 and v2 have same origin. The function compares the vectors by angle in the counter clockwise direction from the axis X. For example, V1 makes 30 degree angle counterclockwise from horizontal x axis V2, makes 270, V3 makes 90, then compareVectors(V1, V2) == -1. compareVectors(V1, V3) == -1. compareVectors(V2, V3) == 1.- Returns:
- Returns 1 if v1 is less than v2, 0 if equal, and 1 if greater.
-
sqrDistance
-
toString
-
setNaN
public void setNaN() -
isNaN
public boolean isNaN() -
_norm
double _norm(int metric) -
offset
returns signed distance of point from infinite line represented by pt_1...pt_2. The returned distance is positive if this point lies on the right-hand side of the line, negative otherwise. If the two input points are equal, the (positive) distance of this point to p_1 is returned. -
orientationRobust
Calculates the orientation of the triangle formed by p, q, r. Returns 1 for counter-clockwise, -1 for clockwise, and 0 for collinear. May use high precision arithmetics for some special degenerate cases. -
inCircleRobustMP_
-
inCircleRobust
Calculates if the point s is inside of the circumcircle inscribed by the clockwise oriented triangle p-q-r. Returns 1 for outside, -1 for inside, and 0 for cocircular. Note that the convention used here differs from what is commonly found in literature, which can define the relation in terms of a counter-clockwise oriented circle, and this flips the sign (think of the signed volume of the tetrahedron). May use high precision arithmetics for some special cases. -
calculateCenterFromThreePointsHelperMP_
-
calculateCenterFromThreePointsHelper_
-
calculateCircleCenterFromThreePoints
-
getAxis
double getAxis(int ordinate)
-