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 intdimensions()The dimension of the point, which is the number of coordinates it has.Point1D<Numerical>normalize()Normalizes this point so that itslengthis 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: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
Point1D<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>- 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: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
Point1D<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>- 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: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
Point1D<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>- 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: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
Point1D<Numerical> normalize()
Description copied from interface:PointNormalizes this point so that itslengthis 1. When its length is 0, returns this point unchanged.
-
scale
Point1D<Numerical> scale(int scale)
Description copied from interface:PointScales this point by the given ratio.
-
scale
Point1D<Numerical> scale(long scale)
Description copied from interface:PointScales this point by the given ratio.
-
scale
Point1D<Numerical> scale(float scale)
Description copied from interface:PointScales this point by the given ratio.
-
scale
Point1D<Numerical> scale(double scale)
Description copied from interface:PointScales this point by the given ratio.
-
scale
Point1D<Numerical> scale(byte scale)
Description copied from interface:PointScales this point by the given ratio.
-
scale
Point1D<Numerical> scale(short scale)
Description copied from interface:PointScales 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: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
Point1D<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>- 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: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
Point1D<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>- 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: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
Point1D<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>- 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: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.
-
-