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()voidvoidprivate static Point2DcalculateCenterFromThreePointsHelper_(Point2D from, Point2D mid_point, Point2D to) private static Point2DcalculateCenterFromThreePointsHelperMP_(Point2D from, Point2D mid_point, Point2D to) (package private) static Point2DcalculateCircleCenterFromThreePoints(Point2D from, Point2D mid_point, Point2D to) intCompares two vertices lexicographically by y.static intcompareVectors(Point2D v1, Point2D v2) Assume vector v1 and v2 have same origin.(package private) intCompares two vertices lexicographically by x.static Point2Dconstruct(double x, double y) doublecrossProduct(Point2D other) static doubledoubledotProduct(Point2D other) booleanboolean(package private) doublegetAxis(int ordinate) intCalculates which quarter of XY plane the vector lies in.inthashCode()(package private) static intinCircleRobust(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 intinCircleRobustMP_(Point2D p, Point2D q, Point2D r, Point2D s) 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()voidvoidvoid(package private) doublereturns signed distance of point from infinite line represented by pt_1...pt_2.static 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
-
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
-
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. -
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
-
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)
-