Interface Point2DLike<Numerical extends Number>

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

    public interface Point2DLike<Numerical extends Number>
    extends Point1DLike<Numerical>
    A point with coordinates of type Number that has a dimension of at least 2. 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​(ECartesianAxis2D 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

        Point2DLike<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 interface Point1DLike<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.
      • coordinate

        Point2DLike<Numerical> coordinate​(ECartesianAxis2D 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​(ECartesianAxis2D 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

        Point2DLike<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 interface Point1DLike<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.
      • coordinateByte

        Point2DLike<Numerical> coordinateByte​(ECartesianAxis2D 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​(ECartesianAxis2D 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

        Point2DLike<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 interface Point1DLike<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.
      • coordinateDouble

        Point2DLike<Numerical> coordinateDouble​(ECartesianAxis2D 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​(ECartesianAxis2D 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

        Point2DLike<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 interface Point1DLike<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.
      • coordinateFloat

        Point2DLike<Numerical> coordinateFloat​(ECartesianAxis2D 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​(ECartesianAxis2D 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

        Point2DLike<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 interface Point1DLike<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.
      • coordinateInt

        Point2DLike<Numerical> coordinateInt​(ECartesianAxis2D 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​(ECartesianAxis2D 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

        Point2DLike<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 interface Point1DLike<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.
      • coordinateLong

        Point2DLike<Numerical> coordinateLong​(ECartesianAxis2D 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​(ECartesianAxis2D 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.
      • coordinateShort

        Point2DLike<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 interface Point1DLike<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.
      • coordinateShort

        Point2DLike<Numerical> coordinateShort​(ECartesianAxis2D 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.
      • rotateDegreesXY

        Point2DLike<Numerical> rotateDegreesXY​(double angleDegrees)
        Rotates this point on the xy plane around the origin by the given angle in degrees, in an anti-clockwise direction.
        Parameters:
        angleDegrees - The angle in angleDegrees to rotate the point.
        Returns:
        A new point that is the result of the rotation.
      • rotateRadiansXY

        Point2DLike<Numerical> rotateRadiansXY​(double angleRadians)
        Rotates this point on the xy plane around the origin (0, 0) by the given angle in radians, in an anti-clockwise direction.
        Parameters:
        angleRadians - The angle in radians to rotate the point.
        Returns:
        A new point that is the result of the rotation.
      • scale

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

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

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

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

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

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

        Point2DLike<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 interface Point1DLike<Numerical extends Number>
        Parameters:
        x - The new x coordinate value
        Returns:
        A point with the specified x coordinate.
      • xByte

        Point2DLike<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 interface Point1DLike<Numerical extends Number>
        Parameters:
        x - The new x coordinate value as a byte
        Returns:
        A point with the specified x coordinate.
      • xDouble

        Point2DLike<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 interface Point1DLike<Numerical extends Number>
        Parameters:
        x - The new x coordinate value as a double
        Returns:
        A point with the specified x coordinate.
      • xFloat

        Point2DLike<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 interface Point1DLike<Numerical extends Number>
        Parameters:
        x - The new x coordinate value as a float
        Returns:
        A point with the specified x coordinate.
      • xInt

        Point2DLike<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 interface Point1DLike<Numerical extends Number>
        Parameters:
        x - The new x coordinate value as an int
        Returns:
        A point with the specified x coordinate.
      • xLong

        Point2DLike<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 interface Point1DLike<Numerical extends Number>
        Parameters:
        x - The new x coordinate value as a long
        Returns:
        A point with the specified x coordinate.
      • xShort

        Point2DLike<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 interface Point1DLike<Numerical extends Number>
        Parameters:
        x - The new x coordinate value as a short
        Returns:
        A point with the specified x coordinate.
      • y

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

        Point2DLike<Numerical> y​(Numerical y)
        Returns a point with the y coordinate set to the given value, while keeping other coordinates unchanged.
        Parameters:
        y - The new y coordinate value
        Returns:
        A point with the specified y coordinate.
      • yByte

        default byte yByte()
        The y coordinate of this point, as a byte.
        Returns:
        the y coordinate
      • yByte

        Point2DLike<Numerical> yByte​(byte yByte)
        Returns a point with the y coordinate set to the given byte value, while keeping other coordinates unchanged.
        Parameters:
        yByte - The new y coordinate value as a byte
        Returns:
        A point with the specified y coordinate.
      • yDouble

        default double yDouble()
        The y coordinate of this point, as a double.
        Returns:
        the y coordinate
      • yDouble

        Point2DLike<Numerical> yDouble​(double yDouble)
        Returns a point with the y coordinate set to the given double value, while keeping other coordinates unchanged.
        Parameters:
        yDouble - The new y coordinate value as a double
        Returns:
        A point with the specified y coordinate.
      • yFloat

        default float yFloat()
        The y coordinate of this point, as a float.
        Returns:
        the y coordinate
      • yFloat

        Point2DLike<Numerical> yFloat​(float yFloat)
        Returns a point with the y coordinate set to the given float value, while keeping other coordinates unchanged.
        Parameters:
        yFloat - The new y coordinate value as a float
        Returns:
        A point with the specified y coordinate.
      • yInt

        default int yInt()
        The y coordinate of this point, as an int.
        Returns:
        the y coordinate
      • yInt

        Point2DLike<Numerical> yInt​(int yInt)
        Returns a point with the y coordinate set to the given int value, while keeping other coordinates unchanged.
        Parameters:
        yInt - The new y coordinate value as an int
        Returns:
        A point with the specified y coordinate.
      • yLong

        default long yLong()
        The y coordinate of this point, as a long.
        Returns:
        the y coordinate
      • yLong

        Point2DLike<Numerical> yLong​(long yLong)
        Returns a point with the y coordinate set to the given long value, while keeping other coordinates unchanged.
        Parameters:
        yLong - The new y coordinate value as a long
        Returns:
        A point with the specified y coordinate.
      • yShort

        default short yShort()
        The y coordinate of this point, as a short.
        Returns:
        the y coordinate
      • yShort

        Point2DLike<Numerical> yShort​(short yShort)
        Returns a point with the y coordinate set to the given short value, while keeping other coordinates unchanged.
        Parameters:
        yShort - The new y coordinate value as a short
        Returns:
        A point with the specified y coordinate.