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:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidintCompares two vertices lexicographically by y.static intcompareVectors(Point2D v1, Point2D v2) Assume vector v1 and v2 have same origin.static Point2Dconstruct(double x, double y) doublecrossProduct(Point2D other) static doubledoubledotProduct(Point2D other) booleanbooleanintCalculates which quarter of XY plane the vector lies in.inthashCode()voidinterpolate(Point2D other, double alpha) voidinterpolate(Point2D p1, Point2D p2, double alpha) booleanisEqual(double x_, double y_) booleanbooleanbooleanisNaN()void90 degree rotation, anticlockwise.void90 degree rotation, anticlockwise.doublelength()voidnegate()voidvoidvoidstatic intorientationRobust(Point2D p, Point2D q, Point2D r) Calculates the orientation of the triangle formed by p, q, r.void270 degree rotation, anticlockwise.void270 degree rotation, anticlockwise.voidrotateDirect(double Cos, double Sin) voidrotateReverse(double Cos, double Sin) voidscale(double f) voidvoidCalculates this = this * f + shiftvoidCalculates this = other * f + shiftvoidsetCoords(double x, double y) voidvoidsetNaN()static doublesqrDistance(Point2D pt1, Point2D pt2) doublevoidvoidtoString()
-
Field Details
-
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
-
sub
-
sub
-
add
-
add
-
negate
public void negate() -
negate
-
interpolate
-
interpolate
-
scaleAdd
Calculates this = this * f + shift- Parameters:
f-shift-
-
scaleAdd
-
scale
-
scale
public void scale(double f) -
compare
Compares two vertices lexicographically by y. -
normalize
-
normalize
public void normalize() -
length
public double length() -
sqrLength
public double sqrLength() -
distance
-
dotProduct
-
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)). -
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
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() -
orientationRobust
-