Interface Point1DLike<Numerical extends Number>

  • Type Parameters:
    Numerical - The type of the coordinates, which must be a subclass of Number.
    All Superinterfaces:
    Point, Serializable
    All Known Subinterfaces:
    Point1D<Numerical>, Point2D<Numerical>, Point2DLike<Numerical>
    All Known Implementing Classes:
    Point2DDouble

    public interface Point1DLike<Numerical extends Number>
    extends Point
    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 Detail

      • coordinate

        Numerical coordinate​(ECartesianAxis1D axis)
        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

        Point1DLike<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.
        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

        default byte coordinateByte​(ECartesianAxis1D axis)
        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

        Point1DLike<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.
        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

        default double coordinateDouble​(ECartesianAxis1D axis)
        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

        Point1DLike<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.
        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

        default float coordinateFloat​(ECartesianAxis1D axis)
        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

        Point1DLike<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.
        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

        default int coordinateInt​(ECartesianAxis1D axis)
        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

        Point1DLike<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.
        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

        default long coordinateLong​(ECartesianAxis1D axis)
        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

        Point1DLike<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.
        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

        default short coordinateShort​(ECartesianAxis1D axis)
        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

        Point1DLike<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.
        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: Point
        Normalizes this point so that its length is 1. When its length is 0, returns this point unchanged.
        Specified by:
        normalize in interface Point
        Returns:
        The normalized point with length 1, or this point unchanged if its length is 0.
      • scale

        Point1DLike<Numerical> scale​(int scale)
        Description copied from interface: Point
        Scales this point by the given ratio.
        Specified by:
        scale in interface Point
        Parameters:
        scale - The ratio in all directions to scale by.
        Returns:
        A new point that is the result of the scaling.
      • scale

        Point1DLike<Numerical> scale​(long scale)
        Description copied from interface: Point
        Scales this point by the given ratio.
        Specified by:
        scale in interface Point
        Parameters:
        scale - The ratio in all directions to scale by.
        Returns:
        A new point that is the result of the scaling.
      • scale

        Point1DLike<Numerical> scale​(float scale)
        Description copied from interface: Point
        Scales this point by the given ratio.
        Specified by:
        scale in interface Point
        Parameters:
        scale - The ratio in all directions to scale by.
        Returns:
        A new point that is the result of the scaling.
      • scale

        Point1DLike<Numerical> scale​(double scale)
        Description copied from interface: Point
        Scales this point by the given ratio.
        Specified by:
        scale in interface Point
        Parameters:
        scale - The ratio in all directions to scale by.
        Returns:
        A new point that is the result of the scaling.
      • scale

        Point1DLike<Numerical> scale​(byte scale)
        Description copied from interface: Point
        Scales this point by the given ratio.
        Specified by:
        scale in interface Point
        Parameters:
        scale - The ratio in all directions to scale by.
        Returns:
        A new point that is the result of the scaling.
      • scale

        Point1DLike<Numerical> scale​(short scale)
        Description copied from interface: Point
        Scales this point by the given ratio.
        Specified by:
        scale in interface Point
        Parameters:
        scale - The ratio in all directions to scale by.
        Returns:
        A new point that is the result of the scaling.
      • x

        Numerical x()
        The x coordinate of this point.
        Returns:
        the x coordinate
      • x

        Point1DLike<Numerical> x​(Numerical 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

        Point1DLike<Numerical> xByte​(byte x)
        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

        Point1DLike<Numerical> xDouble​(double x)
        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

        Point1DLike<Numerical> xFloat​(float x)
        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

        Point1DLike<Numerical> xInt​(int x)
        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

        Point1DLike<Numerical> xLong​(long x)
        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

        Point1DLike<Numerical> xShort​(short x)
        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.