Interface Point1DLike<Numerical extends Number>
- Type Parameters:
Numerical- The type of the coordinates, which must be a subclass ofNumber.
- All Superinterfaces:
Point, Serializable
- All Known Subinterfaces:
Point1D<Numerical>, Point2D<Numerical>, Point2DLike<Numerical>
- All Known Implementing Classes:
Point2DDouble
A 2-dimensional point with coordinates of type
Number. Some operations may be 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
Modifier and TypeMethodDescriptioncoordinate(ECartesianAxis1D axis) Gets the coordinate of this point on the given axis.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.default byteGets the coordinate of this point on the given axis, as a byte.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.default 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.default floatGets the coordinate of this point on the given axis, as a float.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.default intGets the coordinate of this point on the given axis, as an integer.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.default longGets the coordinate of this point on the given axis, as a long.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.default shortGets the coordinate of this point on the given axis, as a short.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.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.x()The x coordinate of this point.Returns a point with the x coordinate set to the given value, while keeping other coordinates unchanged.default bytexByte()The x coordinate of this point, as a byte.xByte(byte x) Returns a point with the x coordinate set to the given byte value, while keeping other coordinates unchanged.default 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.default floatxFloat()The x coordinate of this point, as a float.xFloat(float x) Returns a point with the x coordinate set to the given float value, while keeping other coordinates unchanged.default intxInt()The x coordinate of this point, as an int.xInt(int x) Returns a point with the x coordinate set to the given int value, while keeping other coordinates unchanged.default longxLong()The x coordinate of this point, as a long.xLong(long x) Returns a point with the x coordinate set to the given long value, while keeping other coordinates unchanged.default shortxShort()The x coordinate of this point, as a short.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
dimensions, lengthByte, lengthDouble, lengthFloat, lengthInt, lengthLong, lengthShort
-
Method Details
-
coordinate
Gets the coordinate of this point on the given axis.- Parameters:
axis- The axis for which to get the coordinate.- Returns:
- The coordinate of this point on the given axis.
-
coordinate
Gets a point with the coordinate on the given axis set to the given value, while keeping other coordinates unchanged.- 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
Gets the coordinate of this point on the given axis, as a byte.- Parameters:
axis- The axis for which to get the coordinate.- Returns:
- The coordinate of this point on the given axis.
-
coordinateByte
Gets a point with the coordinate on the given axis set to the given byte value, while keeping other coordinates unchanged.- 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
Gets the coordinate of this point on the given axis, as a double.- Parameters:
axis- The axis for which to get the coordinate.- Returns:
- The coordinate of this point on the given axis.
-
coordinateDouble
Gets a point with the coordinate on the given axis set to the given double value, while keeping other coordinates unchanged.- 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
Gets the coordinate of this point on the given axis, as a float.- Parameters:
axis- The axis for which to get the coordinate.- Returns:
- The coordinate of this point on the given axis.
-
coordinateFloat
Gets a point with the coordinate on the given axis set to the given float value, while keeping other coordinates unchanged.- 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
Gets the coordinate of this point on the given axis, as an integer.- Parameters:
axis- The axis for which to get the coordinate.- Returns:
- The coordinate of this point on the given axis.
-
coordinateInt
Gets a point with the coordinate on the given axis set to the given int value, while keeping other coordinates unchanged.- 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
Gets the coordinate of this point on the given axis, as a long.- Parameters:
axis- The axis for which to get the coordinate.- Returns:
- The coordinate of this point on the given axis.
-
coordinateLong
Gets a point with the coordinate on the given axis set to the given long value, while keeping other coordinates unchanged.- 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
Gets the coordinate of this point on the given axis, as a short.- Parameters:
axis- The axis for which to get the coordinate.- Returns:
- The coordinate of this point on the given axis.
-
coordinateShort
Gets a point with the coordinate on the given axis set to the given short value, while keeping other coordinates unchanged.- 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.
-
normalize
Point1DLike<Numerical> normalize()Description copied from interface:PointNormalizes this point so that itslengthis 1. When its length is 0, returns this point unchanged. -
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. -
x
-
x
Returns a point with the x coordinate set to the given value, while keeping other coordinates unchanged.- Parameters:
x- The new x coordinate value- Returns:
- A point with the specified x coordinate.
-
xByte
default byte xByte()The x coordinate of this point, as a byte.- Returns:
- the x coordinate
-
xByte
Returns a point with the x coordinate set to the given byte value, while keeping other coordinates unchanged.- Parameters:
x- The new x coordinate value as a byte- Returns:
- A point with the specified x coordinate.
-
xDouble
default double xDouble()The x coordinate of this point.- Returns:
- the x coordinate
-
xDouble
Returns a point with the x coordinate set to the given double value, while keeping other coordinates unchanged.- Parameters:
x- The new x coordinate value as a double- Returns:
- A point with the specified x coordinate.
-
xFloat
default float xFloat()The x coordinate of this point, as a float.- Returns:
- the x coordinate
-
xFloat
Returns a point with the x coordinate set to the given float value, while keeping other coordinates unchanged.- Parameters:
x- The new x coordinate value as a float- Returns:
- A point with the specified x coordinate.
-
xInt
default int xInt()The x coordinate of this point, as an int.- Returns:
- the x coordinate
-
xInt
Returns a point with the x coordinate set to the given int value, while keeping other coordinates unchanged.- Parameters:
x- The new x coordinate value as an int- Returns:
- A point with the specified x coordinate.
-
xLong
default long xLong()The x coordinate of this point, as a long.- Returns:
- the x coordinate
-
xLong
Returns a point with the x coordinate set to the given long value, while keeping other coordinates unchanged.- Parameters:
x- The new x coordinate value as a long- Returns:
- A point with the specified x coordinate.
-
xShort
default short xShort()The x coordinate of this point, as a short.- Returns:
- the x coordinate
-
xShort
Returns a point with the x coordinate set to the given short value, while keeping other coordinates unchanged.- Parameters:
x- The new x coordinate value as a short- Returns:
- A point with the specified x coordinate.
-