Class Point2DDouble
java.lang.Object
de.xima.fc.common.geometry.Point2DDouble
- All Implemented Interfaces:
Point, Point1DLike<Double>, Point2D<Double>, Point2DLike<Double>, Serializable
A 2D point with double precision coordinates. Some operations are dependent on the coordinate system's handedness, in
which case a left-handed coordinate system is assumed. This is common in computer graphics, where the x-axis points
to the right and the y-axis points down.
This class is immutable and thread-safe.
- Since:
- 8.4.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPoint2DDouble(double x, double y) Creates a new point with the given coordinates. -
Method Summary
Modifier and TypeMethodDescriptioncoordinate(ECartesianAxis1D axis) Gets the coordinate of this point on the given axis.coordinate(ECartesianAxis1D axis, Double coordinate) Gets a point with the coordinate on the given axis set to the given value, while keeping other coordinates unchanged.coordinate(ECartesianAxis2D axis) Gets the coordinate of this point on the given axis.coordinate(ECartesianAxis2D axis, Double coordinate) Gets a point with the coordinate on the given axis set to the given value, while keeping other coordinates unchanged.coordinateByte(ECartesianAxis1D axis, byte coordinate) Gets a point with the coordinate on the given axis set to the given byte value, while keeping other coordinates unchanged.coordinateByte(ECartesianAxis2D axis, byte coordinate) Gets a point with the coordinate on the given axis set to the given byte value, while keeping other coordinates unchanged.doubleGets the coordinate of this point on the given axis, as a double.coordinateDouble(ECartesianAxis1D axis, double coordinate) Gets a point with the coordinate on the given axis set to the given double value, while keeping other coordinates unchanged.doubleGets the coordinate of this point on the given axis, as a double.coordinateDouble(ECartesianAxis2D axis, double coordinate) Gets a point with the coordinate on the given axis set to the given double value, while keeping other coordinates unchanged.coordinateFloat(ECartesianAxis1D axis, float coordinate) Gets a point with the coordinate on the given axis set to the given float value, while keeping other coordinates unchanged.coordinateFloat(ECartesianAxis2D axis, float coordinate) Gets a point with the coordinate on the given axis set to the given float value, while keeping other coordinates unchanged.coordinateInt(ECartesianAxis1D axis, int coordinate) Gets a point with the coordinate on the given axis set to the given int value, while keeping other coordinates unchanged.coordinateInt(ECartesianAxis2D axis, int coordinate) Gets a point with the coordinate on the given axis set to the given int value, while keeping other coordinates unchanged.coordinateLong(ECartesianAxis1D axis, long coordinate) Gets a point with the coordinate on the given axis set to the given long value, while keeping other coordinates unchanged.coordinateLong(ECartesianAxis2D axis, long coordinate) Gets a point with the coordinate on the given axis set to the given long value, while keeping other coordinates unchanged.coordinateShort(ECartesianAxis1D axis, short coordinate) Gets a point with the coordinate on the given axis set to the given short value, while keeping other coordinates unchanged.coordinateShort(ECartesianAxis2D axis, short coordinate) Gets a point with the coordinate on the given axis set to the given short value, while keeping other coordinates unchanged.epsilonBall(double epsilon) Creates a predicate that returns for all points within the ε-ball centered at this point.booleaninthashCode()byteGets the length of this point as a byte (when interpreted as a vector from the origin).doubleGets the length of this point as a double (when interpreted as a vector from the origin).floatGets the length of this point as a float (when interpreted as a vector from the origin).intGets the length of this point as an int (when interpreted as a vector from the origin).longGets the length of this point as a long (when interpreted as a vector from the origin).shortGets the length of this point as a byte (when interpreted as a vector from the origin).booleannear(Point2DDouble that, double epsilon) Checks whether this point is approximately equal to another point, i.e. whether the distance between the two points is less than or equal to the given epsilon value.Normalizes this point so that itslengthis 1.rotateDegrees(double degrees) Rotates this point around the origin (0, 0) by the given angle in degrees, in an anti-clockwise direction.rotateDegreesXY(double angleDegrees) Rotates this point on the xy plane around the origin by the given angle in degrees, in an anti-clockwise direction.rotateRadians(double radians) Rotates this point around the origin (0, 0) by the given angle in radians, in an anti-clockwise direction.rotateRadiansXY(double angleRadians) Rotates this point on the xy plane around the origin (0, 0) by the given angle in radians, in an anti-clockwise direction.scale(byte scale) Scales this point by the given ratio.scale(byte sx, byte sy) Scales this point by the given ratio.scale(double scale) Scales this point by the given ratio.scale(double sx, double sy) Scales this point by the given ratio.scale(float scale) Scales this point by the given ratio.scale(float sx, float sy) Scales this point by the given ratio.scale(int scale) Scales this point by the given ratio.scale(int sx, int sy) Scales this point by the given ratio.scale(long scale) Scales this point by the given ratio.scale(long sx, long sy) Scales this point by the given ratio.scale(short scale) Scales this point by the given ratio.scale(short sx, short sy) Scales this point by the given ratio.subtract(byte dx, byte dy) Subtracts a given amount from the coordinates of this point.subtract(double dx, double dy) Subtracts a given amount from the coordinates of this point.subtract(float dx, float dy) Subtracts a given amount from the coordinates of this point.subtract(int dx, int dy) Subtracts a given amount from the coordinates of this point.subtract(long dx, long dy) Subtracts a given amount from the coordinates of this point.subtract(short dx, short dy) Subtracts a given amount from the coordinates of this point.subtract(Point2DLike<?> delta) Subtracts the given point from this point.toString()translate(byte dx, byte dy) Translates this point by the given delta.translate(double dx, double dy) Translates this point by the given delta.translate(float dx, float dy) Translates this point by the given delta.translate(int dx, int dy) Translates this point by the given delta.translate(long dx, long dy) Translates this point by the given delta.translate(short dx, short dy) Translates this point by the given delta.translate(Point2DLike<?> delta) Translates this point by the given delta.static Point2DDoubleunitDegrees(double degrees) Gets a unit vector pointing in the specified direction in degrees. 0 is east, 90 is north, 180 is west, and 270 is south.static Point2DDoubleunitRadians(double radians) Gets a unit vector pointing in the specified direction in radians. 0 is east, π/2 is north, π is west, and 3π/2 is south.static Point2DDoubleGets a unit vector pointing in the negative x-direction.static Point2DDoubleGets a unit vector pointing in the positive x-direction.static Point2DDoubleGets a unit vector pointing in the negative y-direction.static Point2DDoubleGets a unit vector pointing in the positive y-direction.x()The x coordinate of this point.Returns a point with the x coordinate set to the given value, while keeping other coordinates unchanged.xByte(byte x) Returns a point with the x coordinate set to the given byte value, while keeping other coordinates unchanged.doublexDouble()The x coordinate of this point.xDouble(double x) Returns a point with the x coordinate set to the given double value, while keeping other coordinates unchanged.xFloat(float x) Returns a point with the x coordinate set to the given float value, while keeping other coordinates unchanged.xInt(int x) Returns a point with the x coordinate set to the given int value, while keeping other coordinates unchanged.xLong(long x) Returns a point with the x coordinate set to the given long value, while keeping other coordinates unchanged.xShort(short x) Returns a point with the x coordinate set to the given short value, while keeping other coordinates unchanged.y()The y coordinate of this point.Returns a point with the y coordinate set to the given value, while keeping other coordinates unchanged.yByte(byte y) Returns a point with the y coordinate set to the given byte value, while keeping other coordinates unchanged.doubleyDouble()The y coordinate of this point, as a double.yDouble(double y) Returns a point with the y coordinate set to the given double value, while keeping other coordinates unchanged.yFloat(float y) Returns a point with the y coordinate set to the given float value, while keeping other coordinates unchanged.yInt(int y) Returns a point with the y coordinate set to the given int value, while keeping other coordinates unchanged.yLong(long y) Returns a point with the y coordinate set to the given long value, while keeping other coordinates unchanged.yShort(short y) Returns a point with the y coordinate set to the given short value, while keeping other coordinates unchanged.static Point2DDoublezero()Gets a point at the origin (0, 0).Methods inherited from interface Point1DLike
coordinateByte, coordinateFloat, coordinateInt, coordinateLong, coordinateShort, xByte, xFloat, xInt, xLong, xShortMethods inherited from interface Point2D
dimensionsMethods inherited from interface Point2DLike
coordinateByte, coordinateFloat, coordinateInt, coordinateLong, coordinateShort, yByte, yFloat, yInt, yLong, yShort
-
Constructor Details
-
Point2DDouble
public Point2DDouble(double x, double y) Creates a new point with the given coordinates.- Parameters:
x- the x coordinatey- the y coordinate
-
-
Method Details
-
coordinate
Description copied from interface:Point1DLikeGets the coordinate of this point on the given axis.- Specified by:
coordinatein interfacePoint1DLike<Double>- Parameters:
axis- The axis for which to get the coordinate.- Returns:
- The coordinate of this point on the given axis.
-
coordinate
Description copied from interface:Point2DLikeGets the coordinate of this point on the given axis.- Specified by:
coordinatein interfacePoint2DLike<Double>- Parameters:
axis- The axis for which to get the coordinate.- Returns:
- The coordinate of this point on the given axis.
-
coordinate
Description copied from interface:Point1DLikeGets a point with the coordinate on the given axis set to the given value, while keeping other coordinates unchanged.- Specified by:
coordinatein interfacePoint1DLike<Double>- Specified by:
coordinatein interfacePoint2D<Double>- Specified by:
coordinatein interfacePoint2DLike<Double>- Parameters:
axis- The axis for which to adjust the coordinate.coordinate- The new coordinate value for the specified axis.- Returns:
- A point with the specified coordinate and all other coordinates unchanged.
-
coordinate
Description copied from interface:Point2DLikeGets a point with the coordinate on the given axis set to the given value, while keeping other coordinates unchanged.- Specified by:
coordinatein interfacePoint2D<Double>- Specified by:
coordinatein interfacePoint2DLike<Double>- Parameters:
axis- The axis for which to adjust the coordinate.coordinate- The new coordinate value for the specified axis.- Returns:
- A point with the specified coordinate and all other coordinates unchanged.
-
coordinateByte
Description copied from interface:Point1DLikeGets a point with the coordinate on the given axis set to the given byte value, while keeping other coordinates unchanged.- Specified by:
coordinateBytein interfacePoint1DLike<Double>- Specified by:
coordinateBytein interfacePoint2D<Double>- Specified by:
coordinateBytein interfacePoint2DLike<Double>- Parameters:
axis- The axis for which to adjust the coordinate.coordinate- The new coordinate value for the specified axis as a byte.- Returns:
- A point with the specified coordinate and all other coordinates unchanged.
-
coordinateByte
Description copied from interface:Point2DLikeGets a point with the coordinate on the given axis set to the given byte value, while keeping other coordinates unchanged.- Specified by:
coordinateBytein interfacePoint2D<Double>- Specified by:
coordinateBytein interfacePoint2DLike<Double>- Parameters:
axis- The axis for which to adjust the coordinate.coordinate- The new coordinate value for the specified axis as a byte.- Returns:
- A point with the specified coordinate and all other coordinates unchanged.
-
coordinateDouble
Description copied from interface:Point1DLikeGets the coordinate of this point on the given axis, as a double.- Specified by:
coordinateDoublein interfacePoint1DLike<Double>- Parameters:
axis- The axis for which to get the coordinate.- Returns:
- The coordinate of this point on the given axis.
-
coordinateDouble
Description copied from interface:Point2DLikeGets the coordinate of this point on the given axis, as a double.- Specified by:
coordinateDoublein interfacePoint2DLike<Double>- Parameters:
axis- The axis for which to get the coordinate.- Returns:
- The coordinate of this point on the given axis.
-
coordinateDouble
Description copied from interface:Point1DLikeGets a point with the coordinate on the given axis set to the given double value, while keeping other coordinates unchanged.- Specified by:
coordinateDoublein interfacePoint1DLike<Double>- Specified by:
coordinateDoublein interfacePoint2D<Double>- Specified by:
coordinateDoublein interfacePoint2DLike<Double>- Parameters:
axis- The axis for which to adjust the coordinate.coordinate- The new coordinate value for the specified axis as a double.- Returns:
- A point with the specified coordinate and all other coordinates unchanged.
-
coordinateDouble
Description copied from interface:Point2DLikeGets a point with the coordinate on the given axis set to the given double value, while keeping other coordinates unchanged.- Specified by:
coordinateDoublein interfacePoint2D<Double>- Specified by:
coordinateDoublein interfacePoint2DLike<Double>- Parameters:
axis- The axis for which to adjust the coordinate.coordinate- The new coordinate value for the specified axis as a double.- Returns:
- A point with the specified coordinate and all other coordinates unchanged.
-
coordinateFloat
Description copied from interface:Point1DLikeGets a point with the coordinate on the given axis set to the given float value, while keeping other coordinates unchanged.- Specified by:
coordinateFloatin interfacePoint1DLike<Double>- Specified by:
coordinateFloatin interfacePoint2D<Double>- Specified by:
coordinateFloatin interfacePoint2DLike<Double>- Parameters:
axis- The axis for which to adjust the coordinate.coordinate- The new coordinate value for the specified axis as a float.- Returns:
- A point with the specified coordinate and all other coordinates unchanged.
-
coordinateFloat
Description copied from interface:Point2DLikeGets a point with the coordinate on the given axis set to the given float value, while keeping other coordinates unchanged.- Specified by:
coordinateFloatin interfacePoint2D<Double>- Specified by:
coordinateFloatin interfacePoint2DLike<Double>- Parameters:
axis- The axis for which to adjust the coordinate.coordinate- The new coordinate value for the specified axis as a float.- Returns:
- A point with the specified coordinate and all other coordinates unchanged.
-
coordinateInt
Description copied from interface:Point1DLikeGets a point with the coordinate on the given axis set to the given int value, while keeping other coordinates unchanged.- Specified by:
coordinateIntin interfacePoint1DLike<Double>- Specified by:
coordinateIntin interfacePoint2D<Double>- Specified by:
coordinateIntin interfacePoint2DLike<Double>- Parameters:
axis- The axis for which to adjust the coordinate.coordinate- The new coordinate value for the specified axis as an int.- Returns:
- A point with the specified coordinate and all other coordinates unchanged.
-
coordinateInt
Description copied from interface:Point2DLikeGets a point with the coordinate on the given axis set to the given int value, while keeping other coordinates unchanged.- Specified by:
coordinateIntin interfacePoint2D<Double>- Specified by:
coordinateIntin interfacePoint2DLike<Double>- Parameters:
axis- The axis for which to adjust the coordinate.coordinate- The new coordinate value for the specified axis as an int.- Returns:
- A point with the specified coordinate and all other coordinates unchanged.
-
coordinateLong
Description copied from interface:Point1DLikeGets a point with the coordinate on the given axis set to the given long value, while keeping other coordinates unchanged.- Specified by:
coordinateLongin interfacePoint1DLike<Double>- Specified by:
coordinateLongin interfacePoint2D<Double>- Specified by:
coordinateLongin interfacePoint2DLike<Double>- Parameters:
axis- The axis for which to adjust the coordinate.coordinate- The new coordinate value for the specified axis as a long.- Returns:
- A point with the specified coordinate and all other coordinates unchanged.
-
coordinateLong
Description copied from interface:Point2DLikeGets a point with the coordinate on the given axis set to the given long value, while keeping other coordinates unchanged.- Specified by:
coordinateLongin interfacePoint2D<Double>- Specified by:
coordinateLongin interfacePoint2DLike<Double>- Parameters:
axis- The axis for which to adjust the coordinate.coordinate- The new coordinate value for the specified axis as a long.- Returns:
- A point with the specified coordinate and all other coordinates unchanged.
-
coordinateShort
Description copied from interface:Point1DLikeGets a point with the coordinate on the given axis set to the given short value, while keeping other coordinates unchanged.- Specified by:
coordinateShortin interfacePoint1DLike<Double>- Specified by:
coordinateShortin interfacePoint2D<Double>- Specified by:
coordinateShortin interfacePoint2DLike<Double>- Parameters:
axis- The axis for which to adjust the coordinate.coordinate- The new coordinate value for the specified axis as a short.- Returns:
- A point with the specified coordinate and all other coordinates unchanged.
-
coordinateShort
Description copied from interface:Point2DLikeGets a point with the coordinate on the given axis set to the given short value, while keeping other coordinates unchanged.- Specified by:
coordinateShortin interfacePoint2D<Double>- Specified by:
coordinateShortin interfacePoint2DLike<Double>- Parameters:
axis- The axis for which to adjust the coordinate.coordinate- The new coordinate value for the specified axis as a short.- Returns:
- A point with the specified coordinate and all other coordinates unchanged.
-
epsilonBall
Creates a predicate that returns for all points within the ε-ball centered at this point. I.e. all points whose distance to this point is less than or equal to the given ε value.- Parameters:
epsilon- The maximum distance for the points to be considered equal- Returns:
- A predicate that returns true for all points within the epsilon-sphere centered at this point.
-
equals
-
hashCode
-
lengthByte
public byte lengthByte()Description copied from interface:PointGets the length of this point as a byte (when interpreted as a vector from the origin).- Specified by:
lengthBytein interfacePoint- Returns:
- The length of this point as a byte.
-
lengthDouble
public double lengthDouble()Description copied from interface:PointGets the length of this point as a double (when interpreted as a vector from the origin).- Specified by:
lengthDoublein interfacePoint- Returns:
- The length of this point as a double.
-
lengthFloat
public float lengthFloat()Description copied from interface:PointGets the length of this point as a float (when interpreted as a vector from the origin).- Specified by:
lengthFloatin interfacePoint- Returns:
- The length of this point as a float.
-
lengthInt
-
lengthLong
public long lengthLong()Description copied from interface:PointGets the length of this point as a long (when interpreted as a vector from the origin).- Specified by:
lengthLongin interfacePoint- Returns:
- The length of this point as a double.
-
lengthShort
public short lengthShort()Description copied from interface:PointGets the length of this point as a byte (when interpreted as a vector from the origin).- Specified by:
lengthShortin interfacePoint- Returns:
- The length of this point as a short.
-
near
Checks whether this point is approximately equal to another point, i.e. whether the distance between the two points is less than or equal to the given epsilon value.This is not an equivalence relation and must not be used where the semantics of
Object.equals(Object)are expected.- Parameters:
that- The point to compare withepsilon- The maximum distance for the points to be considered equal- Returns:
- true if the points are approximately equal, false otherwise
-
normalize
-
rotateDegrees
Description copied from interface:Point2DRotates this point around the origin (0, 0) by the given angle in degrees, in an anti-clockwise direction.- Specified by:
rotateDegreesin interfacePoint2D<Double>- Parameters:
degrees- The angle in angleDegrees to rotate the point.- Returns:
- A new point that is the result of the rotation.
-
rotateDegreesXY
Description copied from interface:Point2DLikeRotates this point on the xy plane around the origin by the given angle in degrees, in an anti-clockwise direction.- Specified by:
rotateDegreesXYin interfacePoint2D<Double>- Specified by:
rotateDegreesXYin interfacePoint2DLike<Double>- Parameters:
angleDegrees- The angle in angleDegrees to rotate the point.- Returns:
- A new point that is the result of the rotation.
-
rotateRadians
Description copied from interface:Point2DRotates this point around the origin (0, 0) by the given angle in radians, in an anti-clockwise direction.- Specified by:
rotateRadiansin interfacePoint2D<Double>- Parameters:
radians- The angle in radians to rotate the point.- Returns:
- A new point that is the result of the rotation.
-
rotateRadiansXY
Description copied from interface:Point2DLikeRotates this point on the xy plane around the origin (0, 0) by the given angle in radians, in an anti-clockwise direction.- Specified by:
rotateRadiansXYin interfacePoint2D<Double>- Specified by:
rotateRadiansXYin interfacePoint2DLike<Double>- Parameters:
angleRadians- The angle in radians to rotate the point.- Returns:
- A new point that is the result of the rotation.
-
scale
Description copied from interface:PointScales this point by the given ratio.- Specified by:
scalein interfacePoint- Specified by:
scalein interfacePoint1DLike<Double>- Specified by:
scalein interfacePoint2D<Double>- Specified by:
scalein interfacePoint2DLike<Double>- Parameters:
scale- The ratio in all directions to scale by.- Returns:
- A new point that is the result of the scaling.
-
scale
Description copied from interface:PointScales this point by the given ratio.- Specified by:
scalein interfacePoint- Specified by:
scalein interfacePoint1DLike<Double>- Specified by:
scalein interfacePoint2D<Double>- Specified by:
scalein interfacePoint2DLike<Double>- Parameters:
scale- The ratio in all directions to scale by.- Returns:
- A new point that is the result of the scaling.
-
scale
Description copied from interface:PointScales this point by the given ratio.- Specified by:
scalein interfacePoint- Specified by:
scalein interfacePoint1DLike<Double>- Specified by:
scalein interfacePoint2D<Double>- Specified by:
scalein interfacePoint2DLike<Double>- Parameters:
scale- The ratio in all directions to scale by.- Returns:
- A new point that is the result of the scaling.
-
scale
Description copied from interface:PointScales this point by the given ratio.- Specified by:
scalein interfacePoint- Specified by:
scalein interfacePoint1DLike<Double>- Specified by:
scalein interfacePoint2D<Double>- Specified by:
scalein interfacePoint2DLike<Double>- Parameters:
scale- The ratio in all directions to scale by.- Returns:
- A new point that is the result of the scaling.
-
scale
Description copied from interface:PointScales this point by the given ratio.- Specified by:
scalein interfacePoint- Specified by:
scalein interfacePoint1DLike<Double>- Specified by:
scalein interfacePoint2D<Double>- Specified by:
scalein interfacePoint2DLike<Double>- Parameters:
scale- The ratio in all directions to scale by.- Returns:
- A new point that is the result of the scaling.
-
scale
Description copied from interface:PointScales this point by the given ratio.- Specified by:
scalein interfacePoint- Specified by:
scalein interfacePoint1DLike<Double>- Specified by:
scalein interfacePoint2D<Double>- Specified by:
scalein interfacePoint2DLike<Double>- Parameters:
scale- The ratio in all directions to scale by.- Returns:
- A new point that is the result of the scaling.
-
scale
Description copied from interface:Point2DScales this point by the given ratio. -
scale
Description copied from interface:Point2DScales this point by the given ratio. -
scale
Description copied from interface:Point2DScales this point by the given ratio. -
scale
Description copied from interface:Point2DScales this point by the given ratio. -
scale
Description copied from interface:Point2DScales this point by the given ratio. -
scale
Description copied from interface:Point2DScales this point by the given ratio. -
subtract
Description copied from interface:Point2DSubtracts a given amount from the coordinates of this point. -
subtract
Description copied from interface:Point2DSubtracts a given amount from the coordinates of this point. -
subtract
Description copied from interface:Point2DSubtracts a given amount from the coordinates of this point. -
subtract
Description copied from interface:Point2DSubtracts a given amount from the coordinates of this point. -
subtract
Description copied from interface:Point2DSubtracts a given amount from the coordinates of this point. -
subtract
Description copied from interface:Point2DSubtracts a given amount from the coordinates of this point. -
subtract
Description copied from interface:Point2DSubtracts the given point from this point. -
toString
-
translate
Description copied from interface:Point2DTranslates this point by the given delta. -
translate
Description copied from interface:Point2DTranslates this point by the given delta. -
translate
Description copied from interface:Point2DTranslates this point by the given delta. -
translate
Description copied from interface:Point2DTranslates this point by the given delta. -
translate
Description copied from interface:Point2DTranslates this point by the given delta. -
translate
Description copied from interface:Point2DTranslates this point by the given delta. -
translate
Description copied from interface:Point2DTranslates this point by the given delta. -
x
Description copied from interface:Point1DLikeReturns a point with the x coordinate set to the given value, while keeping other coordinates unchanged.- Specified by:
xin interfacePoint1DLike<Double>- Specified by:
xin interfacePoint2D<Double>- Specified by:
xin interfacePoint2DLike<Double>- Parameters:
x- The new x coordinate value- Returns:
- A point with the specified x coordinate.
-
x
Description copied from interface:Point1DLikeThe x coordinate of this point.- Specified by:
xin interfacePoint1DLike<Double>- Returns:
- the x coordinate
-
xByte
Description copied from interface:Point1DLikeReturns a point with the x coordinate set to the given byte value, while keeping other coordinates unchanged.- Specified by:
xBytein interfacePoint1DLike<Double>- Specified by:
xBytein interfacePoint2D<Double>- Specified by:
xBytein interfacePoint2DLike<Double>- Parameters:
x- The new x coordinate value as a byte- Returns:
- A point with the specified x coordinate.
-
xDouble
Description copied from interface:Point1DLikeReturns a point with the x coordinate set to the given double value, while keeping other coordinates unchanged.- Specified by:
xDoublein interfacePoint1DLike<Double>- Specified by:
xDoublein interfacePoint2D<Double>- Specified by:
xDoublein interfacePoint2DLike<Double>- Parameters:
x- The new x coordinate value as a double- Returns:
- A point with the specified x coordinate.
-
xDouble
public double xDouble()Description copied from interface:Point1DLikeThe x coordinate of this point.- Specified by:
xDoublein interfacePoint1DLike<Double>- Returns:
- the x coordinate
-
xFloat
Description copied from interface:Point1DLikeReturns a point with the x coordinate set to the given float value, while keeping other coordinates unchanged.- Specified by:
xFloatin interfacePoint1DLike<Double>- Specified by:
xFloatin interfacePoint2D<Double>- Specified by:
xFloatin interfacePoint2DLike<Double>- Parameters:
x- The new x coordinate value as a float- Returns:
- A point with the specified x coordinate.
-
xInt
Description copied from interface:Point1DLikeReturns a point with the x coordinate set to the given int value, while keeping other coordinates unchanged.- Specified by:
xIntin interfacePoint1DLike<Double>- Specified by:
xIntin interfacePoint2D<Double>- Specified by:
xIntin interfacePoint2DLike<Double>- Parameters:
x- The new x coordinate value as an int- Returns:
- A point with the specified x coordinate.
-
xLong
Description copied from interface:Point1DLikeReturns a point with the x coordinate set to the given long value, while keeping other coordinates unchanged.- Specified by:
xLongin interfacePoint1DLike<Double>- Specified by:
xLongin interfacePoint2D<Double>- Specified by:
xLongin interfacePoint2DLike<Double>- Parameters:
x- The new x coordinate value as a long- Returns:
- A point with the specified x coordinate.
-
xShort
Description copied from interface:Point1DLikeReturns a point with the x coordinate set to the given short value, while keeping other coordinates unchanged.- Specified by:
xShortin interfacePoint1DLike<Double>- Specified by:
xShortin interfacePoint2D<Double>- Specified by:
xShortin interfacePoint2DLike<Double>- Parameters:
x- The new x coordinate value as a short- Returns:
- A point with the specified x coordinate.
-
y
Description copied from interface:Point2DLikeReturns a point with the y coordinate set to the given value, while keeping other coordinates unchanged. -
y
Description copied from interface:Point2DLikeThe y coordinate of this point.- Specified by:
yin interfacePoint2DLike<Double>- Returns:
- the y coordinate
-
yByte
Description copied from interface:Point2DLikeReturns a point with the y coordinate set to the given byte value, while keeping other coordinates unchanged. -
yDouble
Description copied from interface:Point2DLikeReturns a point with the y coordinate set to the given double value, while keeping other coordinates unchanged. -
yDouble
public double yDouble()Description copied from interface:Point2DLikeThe y coordinate of this point, as a double.- Specified by:
yDoublein interfacePoint2DLike<Double>- Returns:
- the y coordinate
-
yFloat
Description copied from interface:Point2DLikeReturns a point with the y coordinate set to the given float value, while keeping other coordinates unchanged. -
yInt
Description copied from interface:Point2DLikeReturns a point with the y coordinate set to the given int value, while keeping other coordinates unchanged. -
yLong
Description copied from interface:Point2DLikeReturns a point with the y coordinate set to the given long value, while keeping other coordinates unchanged. -
yShort
Description copied from interface:Point2DLikeReturns a point with the y coordinate set to the given short value, while keeping other coordinates unchanged. -
unitDegrees
Gets a unit vector pointing in the specified direction in degrees. 0 is east, 90 is north, 180 is west, and 270 is south.- Parameters:
degrees- The angle in degrees.- Returns:
- A unit vector pointing in the specified direction.
-
unitRadians
Gets a unit vector pointing in the specified direction in radians. 0 is east, π/2 is north, π is west, and 3π/2 is south.- Parameters:
radians- The angle in radians.- Returns:
- A unit vector pointing in the specified direction.
-
unitXNegative
Gets a unit vector pointing in the negative x-direction.- Returns:
- A unit vector pointing in the negative x-direction.
-
unitXPositive
Gets a unit vector pointing in the positive x-direction.- Returns:
- A unit vector pointing in the positive x-direction.
-
unitYNegative
Gets a unit vector pointing in the negative y-direction.- Returns:
- A unit vector pointing in the negative y-direction.
-
unitYPositive
Gets a unit vector pointing in the positive y-direction.- Returns:
- A unit vector pointing in the positive y-direction.
-
zero
Gets a point at the origin (0, 0).- Returns:
- A point at the origin (0, 0).
-