Package de.xima.fc.common.geometry
Interface Point2D<Numerical extends Number>
-
- Type Parameters:
Numerical- The type of the coordinates, which must be a subclass ofNumber.
- All Superinterfaces:
Point,Point1DLike<Numerical>,Point2DLike<Numerical>,Serializable
- All Known Implementing Classes:
Point2DDouble
public interface Point2D<Numerical extends Number> extends Point2DLike<Numerical>
A 2-dimensional point with coordinates of typeNumber. 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.- Since:
- 8.4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Point2D<Numerical>coordinate(ECartesianAxis1D axis, Numerical coordinate)Gets a point with the coordinate on the given axis set to the given value, while keeping other coordinates unchanged.Point2D<Numerical>coordinate(ECartesianAxis2D axis, Numerical coordinate)Gets a point with the coordinate on the given axis set to the given value, while keeping other coordinates unchanged.Point2D<Numerical>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.Point2D<Numerical>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.Point2D<Numerical>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.Point2D<Numerical>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.Point2D<Numerical>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.Point2D<Numerical>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.Point2D<Numerical>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.Point2D<Numerical>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.Point2D<Numerical>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.Point2D<Numerical>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.Point2D<Numerical>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.Point2D<Numerical>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.default intdimensions()The dimension of the point, which is the number of coordinates it has.Point2D<Numerical>normalize()Normalizes this point so that itslengthis 1.Point2D<Numerical>rotateDegrees(double angleDegrees)Rotates this point around the origin (0, 0) by the given angle in degrees, in an anti-clockwise direction.Point2D<Numerical>rotateDegreesXY(double angleDegrees)Rotates this point on the xy plane around the origin by the given angle in degrees, in an anti-clockwise direction.Point2D<Numerical>rotateRadians(double angleRadians)Rotates this point around the origin (0, 0) by the given angle in radians, in an anti-clockwise direction.Point2D<Numerical>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.Point2D<Numerical>scale(byte scale)Scales this point by the given ratio.Point2D<Numerical>scale(byte sx, byte sy)Scales this point by the given ratio.Point2D<Numerical>scale(double scale)Scales this point by the given ratio.Point2D<Numerical>scale(double sx, double sy)Scales this point by the given ratio.Point2D<Numerical>scale(float scale)Scales this point by the given ratio.Point2D<Numerical>scale(float sx, float sy)Scales this point by the given ratio.Point2D<Numerical>scale(int scale)Scales this point by the given ratio.Point2D<Numerical>scale(int sx, int sy)Scales this point by the given ratio.Point2D<Numerical>scale(long scale)Scales this point by the given ratio.Point2D<Numerical>scale(long sx, long sy)Scales this point by the given ratio.Point2D<Numerical>scale(short scale)Scales this point by the given ratio.Point2D<Numerical>scale(short sx, short sy)Scales this point by the given ratio.Point2D<Numerical>subtract(byte dx, byte dy)Subtracts a given amount from the coordinates of this point.Point2D<Numerical>subtract(double dx, double dy)Subtracts a given amount from the coordinates of this point.Point2D<Numerical>subtract(float dx, float dy)Subtracts a given amount from the coordinates of this point.Point2D<Numerical>subtract(int dx, int dy)Subtracts a given amount from the coordinates of this point.Point2D<Numerical>subtract(long dx, long dy)Subtracts a given amount from the coordinates of this point.Point2D<Numerical>subtract(short dx, short dy)Subtracts a given amount from the coordinates of this point.Point2D<Numerical>subtract(Point2DLike<?> delta)Subtracts the given point from this point.Point2D<Numerical>translate(byte dx, byte dy)Translates this point by the given delta.Point2D<Numerical>translate(double dx, double dy)Translates this point by the given delta.Point2D<Numerical>translate(float dx, float dy)Translates this point by the given delta.Point2D<Numerical>translate(int dx, int dy)Translates this point by the given delta.Point2D<Numerical>translate(long dx, long dy)Translates this point by the given delta.Point2D<Numerical>translate(short dx, short dy)Translates this point by the given delta.Point2D<Numerical>translate(Point2DLike<?> delta)Translates this point by the given delta.Point2D<Numerical>x(Numerical x)Returns a point with the x coordinate set to the given value, while keeping other coordinates unchanged.Point2D<Numerical>xByte(byte x)Returns a point with the x coordinate set to the given byte value, while keeping other coordinates unchanged.Point2D<Numerical>xDouble(double x)Returns a point with the x coordinate set to the given double value, while keeping other coordinates unchanged.Point2D<Numerical>xFloat(float x)Returns a point with the x coordinate set to the given float value, while keeping other coordinates unchanged.Point2D<Numerical>xInt(int x)Returns a point with the x coordinate set to the given int value, while keeping other coordinates unchanged.Point2D<Numerical>xLong(long x)Returns a point with the x coordinate set to the given long value, while keeping other coordinates unchanged.Point2D<Numerical>xShort(short x)Returns a point with the x coordinate set to the given short value, while keeping other coordinates unchanged.Point2D<Numerical>y(Numerical y)Returns a point with the y coordinate set to the given value, while keeping other coordinates unchanged.Point2D<Numerical>yByte(byte y)Returns a point with the y coordinate set to the given byte value, while keeping other coordinates unchanged.Point2D<Numerical>yDouble(double y)Returns a point with the y coordinate set to the given double value, while keeping other coordinates unchanged.Point2D<Numerical>yFloat(float y)Returns a point with the y coordinate set to the given float value, while keeping other coordinates unchanged.Point2D<Numerical>yInt(int y)Returns a point with the y coordinate set to the given int value, while keeping other coordinates unchanged.Point2D<Numerical>yLong(long y)Returns a point with the y coordinate set to the given long value, while keeping other coordinates unchanged.Point2D<Numerical>yShort(short y)Returns a point with the y coordinate set to the given short value, while keeping other coordinates unchanged.-
Methods inherited from interface de.xima.fc.common.geometry.Point
lengthByte, lengthDouble, lengthFloat, lengthInt, lengthLong, lengthShort
-
Methods inherited from interface de.xima.fc.common.geometry.Point1DLike
coordinate, coordinateByte, coordinateDouble, coordinateFloat, coordinateInt, coordinateLong, coordinateShort, x, xByte, xDouble, xFloat, xInt, xLong, xShort
-
Methods inherited from interface de.xima.fc.common.geometry.Point2DLike
coordinate, coordinateByte, coordinateDouble, coordinateFloat, coordinateInt, coordinateLong, coordinateShort, y, yByte, yDouble, yFloat, yInt, yLong, yShort
-
-
-
-
Method Detail
-
coordinate
Point2D<Numerical> coordinate(ECartesianAxis1D axis, Numerical 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<Numerical extends Number>- Specified by:
coordinatein interfacePoint2DLike<Numerical extends Number>- 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
Point2D<Numerical> coordinate(ECartesianAxis2D axis, Numerical 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 interfacePoint2DLike<Numerical extends Number>- 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
Point2D<Numerical> coordinateByte(ECartesianAxis1D axis, byte coordinate)
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<Numerical extends Number>- Specified by:
coordinateBytein interfacePoint2DLike<Numerical extends Number>- 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
Point2D<Numerical> coordinateByte(ECartesianAxis2D axis, byte coordinate)
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 interfacePoint2DLike<Numerical extends Number>- 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
Point2D<Numerical> coordinateDouble(ECartesianAxis1D axis, double coordinate)
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<Numerical extends Number>- Specified by:
coordinateDoublein interfacePoint2DLike<Numerical extends Number>- 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
Point2D<Numerical> coordinateDouble(ECartesianAxis2D axis, double coordinate)
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 interfacePoint2DLike<Numerical extends Number>- 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
Point2D<Numerical> coordinateFloat(ECartesianAxis1D axis, float coordinate)
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<Numerical extends Number>- Specified by:
coordinateFloatin interfacePoint2DLike<Numerical extends Number>- 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
Point2D<Numerical> coordinateFloat(ECartesianAxis2D axis, float coordinate)
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 interfacePoint2DLike<Numerical extends Number>- 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
Point2D<Numerical> coordinateInt(ECartesianAxis1D axis, int coordinate)
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<Numerical extends Number>- Specified by:
coordinateIntin interfacePoint2DLike<Numerical extends Number>- 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
Point2D<Numerical> coordinateInt(ECartesianAxis2D axis, int coordinate)
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 interfacePoint2DLike<Numerical extends Number>- 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
Point2D<Numerical> coordinateLong(ECartesianAxis1D axis, long coordinate)
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<Numerical extends Number>- Specified by:
coordinateLongin interfacePoint2DLike<Numerical extends Number>- 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
Point2D<Numerical> coordinateLong(ECartesianAxis2D axis, long coordinate)
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 interfacePoint2DLike<Numerical extends Number>- 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
Point2D<Numerical> coordinateShort(ECartesianAxis1D axis, short coordinate)
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<Numerical extends Number>- Specified by:
coordinateShortin interfacePoint2DLike<Numerical extends Number>- 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
Point2D<Numerical> coordinateShort(ECartesianAxis2D axis, short coordinate)
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 interfacePoint2DLike<Numerical extends Number>- 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.
-
dimensions
default int dimensions()
Description copied from interface:PointThe dimension of the point, which is the number of coordinates it has.- Specified by:
dimensionsin interfacePoint- Returns:
- The dimensionality of the point.
-
normalize
Point2D<Numerical> normalize()
Description copied from interface:PointNormalizes this point so that itslengthis 1. When its length is 0, returns this point unchanged.- Specified by:
normalizein interfacePoint- Specified by:
normalizein interfacePoint1DLike<Numerical extends Number>- Specified by:
normalizein interfacePoint2DLike<Numerical extends Number>- Returns:
- The normalized point with length 1, or this point unchanged if its length is 0.
-
rotateDegrees
Point2D<Numerical> rotateDegrees(double angleDegrees)
Rotates this point around the origin (0, 0) by the given angle in degrees, in an anti-clockwise direction.- Parameters:
angleDegrees- The angle in angleDegrees to rotate the point.- Returns:
- A new point that is the result of the rotation.
-
rotateDegreesXY
Point2D<Numerical> rotateDegreesXY(double angleDegrees)
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 interfacePoint2DLike<Numerical extends Number>- Parameters:
angleDegrees- The angle in angleDegrees to rotate the point.- Returns:
- A new point that is the result of the rotation.
-
rotateRadians
Point2D<Numerical> rotateRadians(double angleRadians)
Rotates this point around the origin (0, 0) by the given angle in radians, in an anti-clockwise direction.- Parameters:
angleRadians- The angle in radians to rotate the point.- Returns:
- A new point that is the result of the rotation.
-
rotateRadiansXY
Point2D<Numerical> rotateRadiansXY(double angleRadians)
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 interfacePoint2DLike<Numerical extends Number>- Parameters:
angleRadians- The angle in radians to rotate the point.- Returns:
- A new point that is the result of the rotation.
-
scale
Point2D<Numerical> scale(int scale)
Description copied from interface:PointScales this point by the given ratio.- Specified by:
scalein interfacePoint- Specified by:
scalein interfacePoint1DLike<Numerical extends Number>- Specified by:
scalein interfacePoint2DLike<Numerical extends Number>- Parameters:
scale- The ratio in all directions to scale by.- Returns:
- A new point that is the result of the scaling.
-
scale
Point2D<Numerical> scale(long scale)
Description copied from interface:PointScales this point by the given ratio.- Specified by:
scalein interfacePoint- Specified by:
scalein interfacePoint1DLike<Numerical extends Number>- Specified by:
scalein interfacePoint2DLike<Numerical extends Number>- Parameters:
scale- The ratio in all directions to scale by.- Returns:
- A new point that is the result of the scaling.
-
scale
Point2D<Numerical> scale(float scale)
Description copied from interface:PointScales this point by the given ratio.- Specified by:
scalein interfacePoint- Specified by:
scalein interfacePoint1DLike<Numerical extends Number>- Specified by:
scalein interfacePoint2DLike<Numerical extends Number>- Parameters:
scale- The ratio in all directions to scale by.- Returns:
- A new point that is the result of the scaling.
-
scale
Point2D<Numerical> scale(double scale)
Description copied from interface:PointScales this point by the given ratio.- Specified by:
scalein interfacePoint- Specified by:
scalein interfacePoint1DLike<Numerical extends Number>- Specified by:
scalein interfacePoint2DLike<Numerical extends Number>- Parameters:
scale- The ratio in all directions to scale by.- Returns:
- A new point that is the result of the scaling.
-
scale
Point2D<Numerical> scale(byte scale)
Description copied from interface:PointScales this point by the given ratio.- Specified by:
scalein interfacePoint- Specified by:
scalein interfacePoint1DLike<Numerical extends Number>- Specified by:
scalein interfacePoint2DLike<Numerical extends Number>- Parameters:
scale- The ratio in all directions to scale by.- Returns:
- A new point that is the result of the scaling.
-
scale
Point2D<Numerical> scale(short scale)
Description copied from interface:PointScales this point by the given ratio.- Specified by:
scalein interfacePoint- Specified by:
scalein interfacePoint1DLike<Numerical extends Number>- Specified by:
scalein interfacePoint2DLike<Numerical extends Number>- Parameters:
scale- The ratio in all directions to scale by.- Returns:
- A new point that is the result of the scaling.
-
scale
Point2D<Numerical> scale(byte sx, byte sy)
Scales this point by the given ratio.- Parameters:
sx- The ratio in x-direction to scale by.sy- The ratio in y-direction to scale by.- Returns:
- A new point that is the result of the scaling.
-
scale
Point2D<Numerical> scale(short sx, short sy)
Scales this point by the given ratio.- Parameters:
sx- The ratio in x-direction to scale by.sy- The ratio in y-direction to scale by.- Returns:
- A new point that is the result of the scaling.
-
scale
Point2D<Numerical> scale(int sx, int sy)
Scales this point by the given ratio.- Parameters:
sx- The ratio in x-direction to scale by.sy- The ratio in y-direction to scale by.- Returns:
- A new point that is the result of the scaling.
-
scale
Point2D<Numerical> scale(long sx, long sy)
Scales this point by the given ratio.- Parameters:
sx- The ratio in x-direction to scale by.sy- The ratio in y-direction to scale by.- Returns:
- A new point that is the result of the scaling.
-
scale
Point2D<Numerical> scale(float sx, float sy)
Scales this point by the given ratio.- Parameters:
sx- The ratio in x-direction to scale by.sy- The ratio in y-direction to scale by.- Returns:
- A new point that is the result of the scaling.
-
scale
Point2D<Numerical> scale(double sx, double sy)
Scales this point by the given ratio.- Parameters:
sx- The ratio in x-direction to scale by.sy- The ratio in y-direction to scale by.- Returns:
- A new point that is the result of the scaling.
-
subtract
Point2D<Numerical> subtract(byte dx, byte dy)
Subtracts a given amount from the coordinates of this point.- Parameters:
dx- The delta in x-direction to subtract.dy- The delta in y-direction to subtract.- Returns:
- A new point that is the result of the subtraction.
-
subtract
Point2D<Numerical> subtract(int dx, int dy)
Subtracts a given amount from the coordinates of this point.- Parameters:
dx- The delta in x-direction to subtract.dy- The delta in y-direction to subtract.- Returns:
- A new point that is the result of the subtraction.
-
subtract
Point2D<Numerical> subtract(short dx, short dy)
Subtracts a given amount from the coordinates of this point.- Parameters:
dx- The delta in x-direction to subtract.dy- The delta in y-direction to subtract.- Returns:
- A new point that is the result of the subtraction.
-
subtract
Point2D<Numerical> subtract(long dx, long dy)
Subtracts a given amount from the coordinates of this point.- Parameters:
dx- The delta in x-direction to subtract.dy- The delta in y-direction to subtract.- Returns:
- A new point that is the result of the subtraction.
-
subtract
Point2D<Numerical> subtract(float dx, float dy)
Subtracts a given amount from the coordinates of this point.- Parameters:
dx- The delta in x-direction to subtract.dy- The delta in y-direction to subtract.- Returns:
- A new point that is the result of the subtraction.
-
subtract
Point2D<Numerical> subtract(double dx, double dy)
Subtracts a given amount from the coordinates of this point.- Parameters:
dx- The delta in x-direction to subtract.dy- The delta in y-direction to subtract.- Returns:
- A new point that is the result of the subtraction.
-
subtract
Point2D<Numerical> subtract(Point2DLike<?> delta)
Subtracts the given point from this point.- Parameters:
delta- The point to subtract.- Returns:
- A new point that is the result of the subtraction.
-
translate
Point2D<Numerical> translate(byte dx, byte dy)
Translates this point by the given delta.- Parameters:
dx- The delta in x-direction to translate by.dy- The delta in y-direction to translate by.- Returns:
- A new point that is the result of the translation.
-
translate
Point2D<Numerical> translate(int dx, int dy)
Translates this point by the given delta.- Parameters:
dx- The delta in x-direction to translate by.dy- The delta in y-direction to translate by.- Returns:
- A new point that is the result of the translation.
-
translate
Point2D<Numerical> translate(short dx, short dy)
Translates this point by the given delta.- Parameters:
dx- The delta in x-direction to translate by.dy- The delta in y-direction to translate by.- Returns:
- A new point that is the result of the translation.
-
translate
Point2D<Numerical> translate(long dx, long dy)
Translates this point by the given delta.- Parameters:
dx- The delta in x-direction to translate by.dy- The delta in y-direction to translate by.- Returns:
- A new point that is the result of the translation.
-
translate
Point2D<Numerical> translate(float dx, float dy)
Translates this point by the given delta.- Parameters:
dx- The delta in x-direction to translate by.dy- The delta in y-direction to translate by.- Returns:
- A new point that is the result of the translation.
-
translate
Point2D<Numerical> translate(double dx, double dy)
Translates this point by the given delta.- Parameters:
dx- The delta in x-direction to translate by.dy- The delta in y-direction to translate by.- Returns:
- A new point that is the result of the translation.
-
translate
Point2D<Numerical> translate(Point2DLike<?> delta)
Translates this point by the given delta.- Parameters:
delta- The delta to translate by.- Returns:
- A new point that is the result of the translation.
-
x
Point2D<Numerical> x(Numerical 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<Numerical extends Number>- Specified by:
xin interfacePoint2DLike<Numerical extends Number>- Parameters:
x- The new x coordinate value- Returns:
- A point with the specified x coordinate.
-
xByte
Point2D<Numerical> xByte(byte x)
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<Numerical extends Number>- Specified by:
xBytein interfacePoint2DLike<Numerical extends Number>- Parameters:
x- The new x coordinate value as a byte- Returns:
- A point with the specified x coordinate.
-
xDouble
Point2D<Numerical> xDouble(double x)
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<Numerical extends Number>- Specified by:
xDoublein interfacePoint2DLike<Numerical extends Number>- Parameters:
x- The new x coordinate value as a double- Returns:
- A point with the specified x coordinate.
-
xFloat
Point2D<Numerical> xFloat(float x)
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<Numerical extends Number>- Specified by:
xFloatin interfacePoint2DLike<Numerical extends Number>- Parameters:
x- The new x coordinate value as a float- Returns:
- A point with the specified x coordinate.
-
xInt
Point2D<Numerical> xInt(int x)
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<Numerical extends Number>- Specified by:
xIntin interfacePoint2DLike<Numerical extends Number>- Parameters:
x- The new x coordinate value as an int- Returns:
- A point with the specified x coordinate.
-
xLong
Point2D<Numerical> xLong(long x)
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<Numerical extends Number>- Specified by:
xLongin interfacePoint2DLike<Numerical extends Number>- Parameters:
x- The new x coordinate value as a long- Returns:
- A point with the specified x coordinate.
-
xShort
Point2D<Numerical> xShort(short x)
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<Numerical extends Number>- Specified by:
xShortin interfacePoint2DLike<Numerical extends Number>- Parameters:
x- The new x coordinate value as a short- Returns:
- A point with the specified x coordinate.
-
y
Point2D<Numerical> y(Numerical y)
Description copied from interface:Point2DLikeReturns a point with the y coordinate set to the given value, while keeping other coordinates unchanged.- Specified by:
yin interfacePoint2DLike<Numerical extends Number>- Parameters:
y- The new y coordinate value- Returns:
- A point with the specified y coordinate.
-
yByte
Point2D<Numerical> yByte(byte y)
Description copied from interface:Point2DLikeReturns a point with the y coordinate set to the given byte value, while keeping other coordinates unchanged.- Specified by:
yBytein interfacePoint2DLike<Numerical extends Number>- Parameters:
y- The new y coordinate value as a byte- Returns:
- A point with the specified y coordinate.
-
yDouble
Point2D<Numerical> yDouble(double y)
Description copied from interface:Point2DLikeReturns a point with the y coordinate set to the given double value, while keeping other coordinates unchanged.- Specified by:
yDoublein interfacePoint2DLike<Numerical extends Number>- Parameters:
y- The new y coordinate value as a double- Returns:
- A point with the specified y coordinate.
-
yFloat
Point2D<Numerical> yFloat(float y)
Description copied from interface:Point2DLikeReturns a point with the y coordinate set to the given float value, while keeping other coordinates unchanged.- Specified by:
yFloatin interfacePoint2DLike<Numerical extends Number>- Parameters:
y- The new y coordinate value as a float- Returns:
- A point with the specified y coordinate.
-
yInt
Point2D<Numerical> yInt(int y)
Description copied from interface:Point2DLikeReturns a point with the y coordinate set to the given int value, while keeping other coordinates unchanged.- Specified by:
yIntin interfacePoint2DLike<Numerical extends Number>- Parameters:
y- The new y coordinate value as an int- Returns:
- A point with the specified y coordinate.
-
yLong
Point2D<Numerical> yLong(long y)
Description copied from interface:Point2DLikeReturns a point with the y coordinate set to the given long value, while keeping other coordinates unchanged.- Specified by:
yLongin interfacePoint2DLike<Numerical extends Number>- Parameters:
y- The new y coordinate value as a long- Returns:
- A point with the specified y coordinate.
-
yShort
Point2D<Numerical> yShort(short y)
Description copied from interface:Point2DLikeReturns a point with the y coordinate set to the given short value, while keeping other coordinates unchanged.- Specified by:
yShortin interfacePoint2DLike<Numerical extends Number>- Parameters:
y- The new y coordinate value as a short- Returns:
- A point with the specified y coordinate.
-
-