Interface Point1D<Numerical extends Number>
- Type Parameters:
Numerical- The type of the coordinates, which must be a subclass ofNumber.
- All Superinterfaces:
Point, Point1DLike<Numerical>, Serializable
A 2-dimensional point with coordinates of type
Number.- Since:
- 8.4.0
-
Method Summary
Modifier and TypeMethodDescriptioncoordinate(ECartesianAxis1D axis, Numerical 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.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.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.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.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.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.default intThe dimension of the point, which is the number of coordinates it has.Normalizes this point so that itslengthis 1.scale(byte scale) Scales this point by the given ratio.scale(double scale) Scales this point by the given ratio.scale(float scale) Scales this point by the given ratio.scale(int scale) Scales this point by the given ratio.scale(long scale) Scales this point by the given ratio.scale(short scale) Scales this point by the given ratio.translateBy(Point1DLike<Numerical> delta) Translates the point by a given delta.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.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.Methods inherited from interface Point
lengthByte, lengthDouble, lengthFloat, lengthInt, lengthLong, lengthShortMethods inherited from interface Point1DLike
coordinate, coordinateByte, coordinateDouble, coordinateFloat, coordinateInt, coordinateLong, coordinateShort, x, xByte, xDouble, xFloat, xInt, xLong, xShort
-
Method Details
-
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>- 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<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
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>- 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<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
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>- 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<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
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>- 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
-
scale
Description copied from interface:PointScales this point by the given ratio. -
scale
Description copied from interface:PointScales this point by the given ratio. -
scale
Description copied from interface:PointScales this point by the given ratio. -
scale
Description copied from interface:PointScales this point by the given ratio. -
scale
Description copied from interface:PointScales this point by the given ratio. -
scale
Description copied from interface:PointScales this point by the given ratio. -
translateBy
Translates the point by a given delta.- Parameters:
delta- The delta by which to translate the point.- Returns:
- The translated point.
-
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>- Parameters:
x- The new x coordinate value- Returns:
- A point with the specified 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<Numerical extends Number>- 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<Numerical extends Number>- Parameters:
x- The new x coordinate value as a double- Returns:
- A point with the specified 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<Numerical extends Number>- 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<Numerical extends Number>- 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<Numerical extends Number>- 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<Numerical extends Number>- Parameters:
x- The new x coordinate value as a short- Returns:
- A point with the specified x coordinate.
-