Package de.xima.fc.common.geometry
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
public interface Point1D<Numerical extends Number> extends Point1DLike<Numerical>
A 2-dimensional point with coordinates of typeNumber
.- Since:
- 8.4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Point1D<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.Point1D<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.Point1D<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.Point1D<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.Point1D<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.Point1D<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.Point1D<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.default int
dimensions()
The dimension of the point, which is the number of coordinates it has.Point1D<Numerical>
normalize()
Normalizes this point so that itslength
is 1.Point1D<Numerical>
scale(byte scale)
Scales this point by the given ratio.Point1D<Numerical>
scale(double scale)
Scales this point by the given ratio.Point1D<Numerical>
scale(float scale)
Scales this point by the given ratio.Point1D<Numerical>
scale(int scale)
Scales this point by the given ratio.Point1D<Numerical>
scale(long scale)
Scales this point by the given ratio.Point1D<Numerical>
scale(short scale)
Scales this point by the given ratio.Point1D<Numerical>
translateBy(Point1DLike<Numerical> delta)
Translates the point by a given delta.Point1D<Numerical>
x(Numerical x)
Returns a point with the x coordinate set to the given value, while keeping other coordinates unchanged.Point1D<Numerical>
xByte(byte x)
Returns a point with the x coordinate set to the given byte value, while keeping other coordinates unchanged.Point1D<Numerical>
xDouble(double x)
Returns a point with the x coordinate set to the given double value, while keeping other coordinates unchanged.Point1D<Numerical>
xFloat(float x)
Returns a point with the x coordinate set to the given float value, while keeping other coordinates unchanged.Point1D<Numerical>
xInt(int x)
Returns a point with the x coordinate set to the given int value, while keeping other coordinates unchanged.Point1D<Numerical>
xLong(long x)
Returns a point with the x coordinate set to the given long value, while keeping other coordinates unchanged.Point1D<Numerical>
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 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
-
-
-
-
Method Detail
-
coordinate
Point1D<Numerical> coordinate(ECartesianAxis1D axis, Numerical coordinate)
Description copied from interface:Point1DLike
Gets a point with the coordinate on the given axis set to the given value, while keeping other coordinates unchanged.- Specified by:
coordinate
in 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
Point1D<Numerical> coordinateByte(ECartesianAxis1D axis, byte coordinate)
Description copied from interface:Point1DLike
Gets a point with the coordinate on the given axis set to the given byte value, while keeping other coordinates unchanged.- Specified by:
coordinateByte
in 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
Point1D<Numerical> coordinateDouble(ECartesianAxis1D axis, double coordinate)
Description copied from interface:Point1DLike
Gets a point with the coordinate on the given axis set to the given double value, while keeping other coordinates unchanged.- Specified by:
coordinateDouble
in 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
Point1D<Numerical> coordinateFloat(ECartesianAxis1D axis, float coordinate)
Description copied from interface:Point1DLike
Gets a point with the coordinate on the given axis set to the given float value, while keeping other coordinates unchanged.- Specified by:
coordinateFloat
in 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
Point1D<Numerical> coordinateInt(ECartesianAxis1D axis, int coordinate)
Description copied from interface:Point1DLike
Gets a point with the coordinate on the given axis set to the given int value, while keeping other coordinates unchanged.- Specified by:
coordinateInt
in 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
Point1D<Numerical> coordinateLong(ECartesianAxis1D axis, long coordinate)
Description copied from interface:Point1DLike
Gets a point with the coordinate on the given axis set to the given long value, while keeping other coordinates unchanged.- Specified by:
coordinateLong
in 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
Point1D<Numerical> coordinateShort(ECartesianAxis1D axis, short coordinate)
Description copied from interface:Point1DLike
Gets a point with the coordinate on the given axis set to the given short value, while keeping other coordinates unchanged.- Specified by:
coordinateShort
in 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:Point
The dimension of the point, which is the number of coordinates it has.- Specified by:
dimensions
in interfacePoint
- Returns:
- The dimensionality of the point.
-
normalize
Point1D<Numerical> normalize()
Description copied from interface:Point
Normalizes this point so that itslength
is 1. When its length is 0, returns this point unchanged.
-
scale
Point1D<Numerical> scale(int scale)
Description copied from interface:Point
Scales this point by the given ratio.
-
scale
Point1D<Numerical> scale(long scale)
Description copied from interface:Point
Scales this point by the given ratio.
-
scale
Point1D<Numerical> scale(float scale)
Description copied from interface:Point
Scales this point by the given ratio.
-
scale
Point1D<Numerical> scale(double scale)
Description copied from interface:Point
Scales this point by the given ratio.
-
scale
Point1D<Numerical> scale(byte scale)
Description copied from interface:Point
Scales this point by the given ratio.
-
scale
Point1D<Numerical> scale(short scale)
Description copied from interface:Point
Scales this point by the given ratio.
-
translateBy
Point1D<Numerical> translateBy(Point1DLike<Numerical> delta)
Translates the point by a given delta.- Parameters:
delta
- The delta by which to translate the point.- Returns:
- The translated point.
-
x
Point1D<Numerical> x(Numerical x)
Description copied from interface:Point1DLike
Returns a point with the x coordinate set to the given value, while keeping other coordinates unchanged.- Specified by:
x
in interfacePoint1DLike<Numerical extends Number>
- Parameters:
x
- The new x coordinate value- Returns:
- A point with the specified x coordinate.
-
xByte
Point1D<Numerical> xByte(byte x)
Description copied from interface:Point1DLike
Returns a point with the x coordinate set to the given byte value, while keeping other coordinates unchanged.- Specified by:
xByte
in interfacePoint1DLike<Numerical extends Number>
- Parameters:
x
- The new x coordinate value as a byte- Returns:
- A point with the specified x coordinate.
-
xDouble
Point1D<Numerical> xDouble(double x)
Description copied from interface:Point1DLike
Returns a point with the x coordinate set to the given double value, while keeping other coordinates unchanged.- Specified by:
xDouble
in interfacePoint1DLike<Numerical extends Number>
- Parameters:
x
- The new x coordinate value as a double- Returns:
- A point with the specified x coordinate.
-
xFloat
Point1D<Numerical> xFloat(float x)
Description copied from interface:Point1DLike
Returns a point with the x coordinate set to the given float value, while keeping other coordinates unchanged.- Specified by:
xFloat
in interfacePoint1DLike<Numerical extends Number>
- Parameters:
x
- The new x coordinate value as a float- Returns:
- A point with the specified x coordinate.
-
xInt
Point1D<Numerical> xInt(int x)
Description copied from interface:Point1DLike
Returns a point with the x coordinate set to the given int value, while keeping other coordinates unchanged.- Specified by:
xInt
in interfacePoint1DLike<Numerical extends Number>
- Parameters:
x
- The new x coordinate value as an int- Returns:
- A point with the specified x coordinate.
-
xLong
Point1D<Numerical> xLong(long x)
Description copied from interface:Point1DLike
Returns a point with the x coordinate set to the given long value, while keeping other coordinates unchanged.- Specified by:
xLong
in interfacePoint1DLike<Numerical extends Number>
- Parameters:
x
- The new x coordinate value as a long- Returns:
- A point with the specified x coordinate.
-
xShort
Point1D<Numerical> xShort(short x)
Description copied from interface:Point1DLike
Returns a point with the x coordinate set to the given short value, while keeping other coordinates unchanged.- Specified by:
xShort
in interfacePoint1DLike<Numerical extends Number>
- Parameters:
x
- The new x coordinate value as a short- Returns:
- A point with the specified x coordinate.
-
-