Class Point2DDouble

  • All Implemented Interfaces:
    Point, Point1DLike<Double>, Point2D<Double>, Point2DLike<Double>, Serializable

    public final class Point2DDouble
    extends Object
    implements Point2D<Double>
    A 2D point with double precision coordinates. Some operations are 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.

    This class is immutable and thread-safe.

    Since:
    8.4.0
    See Also:
    Serialized Form
    • Constructor Detail

      • Point2DDouble

        public Point2DDouble​(double x,
                             double y)
        Creates a new point with the given coordinates.
        Parameters:
        x - the x coordinate
        y - the y coordinate
    • Method Detail

      • coordinate

        public Double coordinate​(ECartesianAxis1D axis)
        Description copied from interface: Point1DLike
        Gets the coordinate of this point on the given axis.
        Specified by:
        coordinate in interface Point1DLike<Double>
        Parameters:
        axis - The axis for which to get the coordinate.
        Returns:
        The coordinate of this point on the given axis.
      • coordinate

        public Double coordinate​(ECartesianAxis2D axis)
        Description copied from interface: Point2DLike
        Gets the coordinate of this point on the given axis.
        Specified by:
        coordinate in interface Point2DLike<Double>
        Parameters:
        axis - The axis for which to get the coordinate.
        Returns:
        The coordinate of this point on the given axis.
      • coordinate

        public Point2DDouble coordinate​(ECartesianAxis1D axis,
                                        Double 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<Double>
        Specified by:
        coordinate in interface Point2D<Double>
        Specified by:
        coordinate in interface Point2DLike<Double>
        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

        public Point2DDouble coordinate​(ECartesianAxis2D axis,
                                        Double coordinate)
        Description copied from interface: Point2DLike
        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 Point2D<Double>
        Specified by:
        coordinate in interface Point2DLike<Double>
        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

        public Point2DDouble 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<Double>
        Specified by:
        coordinateByte in interface Point2D<Double>
        Specified by:
        coordinateByte in interface Point2DLike<Double>
        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

        public Point2DDouble coordinateByte​(ECartesianAxis2D axis,
                                            byte coordinate)
        Description copied from interface: Point2DLike
        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 Point2D<Double>
        Specified by:
        coordinateByte in interface Point2DLike<Double>
        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

        public double coordinateDouble​(ECartesianAxis1D axis)
        Description copied from interface: Point1DLike
        Gets the coordinate of this point on the given axis, as a double.
        Specified by:
        coordinateDouble in interface Point1DLike<Double>
        Parameters:
        axis - The axis for which to get the coordinate.
        Returns:
        The coordinate of this point on the given axis.
      • coordinateDouble

        public double coordinateDouble​(ECartesianAxis2D axis)
        Description copied from interface: Point2DLike
        Gets the coordinate of this point on the given axis, as a double.
        Specified by:
        coordinateDouble in interface Point2DLike<Double>
        Parameters:
        axis - The axis for which to get the coordinate.
        Returns:
        The coordinate of this point on the given axis.
      • coordinateDouble

        public Point2DDouble 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<Double>
        Specified by:
        coordinateDouble in interface Point2D<Double>
        Specified by:
        coordinateDouble in interface Point2DLike<Double>
        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

        public Point2DDouble coordinateDouble​(ECartesianAxis2D axis,
                                              double coordinate)
        Description copied from interface: Point2DLike
        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 Point2D<Double>
        Specified by:
        coordinateDouble in interface Point2DLike<Double>
        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

        public Point2DDouble 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<Double>
        Specified by:
        coordinateFloat in interface Point2D<Double>
        Specified by:
        coordinateFloat in interface Point2DLike<Double>
        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

        public Point2DDouble coordinateFloat​(ECartesianAxis2D axis,
                                             float coordinate)
        Description copied from interface: Point2DLike
        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 Point2D<Double>
        Specified by:
        coordinateFloat in interface Point2DLike<Double>
        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

        public Point2DDouble 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<Double>
        Specified by:
        coordinateInt in interface Point2D<Double>
        Specified by:
        coordinateInt in interface Point2DLike<Double>
        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

        public Point2DDouble coordinateInt​(ECartesianAxis2D axis,
                                           int coordinate)
        Description copied from interface: Point2DLike
        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 Point2D<Double>
        Specified by:
        coordinateInt in interface Point2DLike<Double>
        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

        public Point2DDouble 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<Double>
        Specified by:
        coordinateLong in interface Point2D<Double>
        Specified by:
        coordinateLong in interface Point2DLike<Double>
        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

        public Point2DDouble coordinateLong​(ECartesianAxis2D axis,
                                            long coordinate)
        Description copied from interface: Point2DLike
        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 Point2D<Double>
        Specified by:
        coordinateLong in interface Point2DLike<Double>
        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

        public Point2DDouble 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<Double>
        Specified by:
        coordinateShort in interface Point2D<Double>
        Specified by:
        coordinateShort in interface Point2DLike<Double>
        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

        public Point2DDouble coordinateShort​(ECartesianAxis2D axis,
                                             short coordinate)
        Description copied from interface: Point2DLike
        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 Point2D<Double>
        Specified by:
        coordinateShort in interface Point2DLike<Double>
        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.
      • epsilonBall

        public Predicate<Point2DDouble> epsilonBall​(double epsilon)
        Creates a predicate that returns for all points within the ε-ball centered at this point. I.e. all points whose distance to this point is less than or equal to the given ε value.
        Parameters:
        epsilon - The maximum distance for the points to be considered equal
        Returns:
        A predicate that returns true for all points within the epsilon-sphere centered at this point.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • lengthByte

        public byte lengthByte()
        Description copied from interface: Point
        Gets the length of this point as a byte (when interpreted as a vector from the origin).
        Specified by:
        lengthByte in interface Point
        Returns:
        The length of this point as a byte.
      • lengthDouble

        public double lengthDouble()
        Description copied from interface: Point
        Gets the length of this point as a double (when interpreted as a vector from the origin).
        Specified by:
        lengthDouble in interface Point
        Returns:
        The length of this point as a double.
      • lengthFloat

        public float lengthFloat()
        Description copied from interface: Point
        Gets the length of this point as a float (when interpreted as a vector from the origin).
        Specified by:
        lengthFloat in interface Point
        Returns:
        The length of this point as a float.
      • lengthInt

        public int lengthInt()
        Description copied from interface: Point
        Gets the length of this point as an int (when interpreted as a vector from the origin).
        Specified by:
        lengthInt in interface Point
        Returns:
        The length of this point as an int.
      • lengthLong

        public long lengthLong()
        Description copied from interface: Point
        Gets the length of this point as a long (when interpreted as a vector from the origin).
        Specified by:
        lengthLong in interface Point
        Returns:
        The length of this point as a double.
      • lengthShort

        public short lengthShort()
        Description copied from interface: Point
        Gets the length of this point as a byte (when interpreted as a vector from the origin).
        Specified by:
        lengthShort in interface Point
        Returns:
        The length of this point as a short.
      • near

        public boolean near​(Point2DDouble that,
                            double epsilon)
        Checks whether this point is approximately equal to another point, i.e. whether the distance between the two points is less than or equal to the given epsilon value.

        This is not an equivalence relation and must not be used where the semantics of Object.equals(Object) are expected.

        Parameters:
        that - The point to compare with
        epsilon - The maximum distance for the points to be considered equal
        Returns:
        true if the points are approximately equal, false otherwise
      • rotateDegrees

        public Point2DDouble rotateDegrees​(double degrees)
        Description copied from interface: Point2D
        Rotates this point around the origin (0, 0) by the given angle in degrees, in an anti-clockwise direction.
        Specified by:
        rotateDegrees in interface Point2D<Double>
        Parameters:
        degrees - The angle in angleDegrees to rotate the point.
        Returns:
        A new point that is the result of the rotation.
      • rotateDegreesXY

        public Point2DDouble rotateDegreesXY​(double angleDegrees)
        Description copied from interface: Point2DLike
        Rotates this point on the xy plane around the origin by the given angle in degrees, in an anti-clockwise direction.
        Specified by:
        rotateDegreesXY in interface Point2D<Double>
        Specified by:
        rotateDegreesXY in interface Point2DLike<Double>
        Parameters:
        angleDegrees - The angle in angleDegrees to rotate the point.
        Returns:
        A new point that is the result of the rotation.
      • rotateRadians

        public Point2DDouble rotateRadians​(double radians)
        Description copied from interface: Point2D
        Rotates this point around the origin (0, 0) by the given angle in radians, in an anti-clockwise direction.
        Specified by:
        rotateRadians in interface Point2D<Double>
        Parameters:
        radians - The angle in radians to rotate the point.
        Returns:
        A new point that is the result of the rotation.
      • rotateRadiansXY

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

        public Point2DDouble 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<Double>
        Specified by:
        scale in interface Point2D<Double>
        Specified by:
        scale in interface Point2DLike<Double>
        Parameters:
        scale - The ratio in all directions to scale by.
        Returns:
        A new point that is the result of the scaling.
      • scale

        public Point2DDouble 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<Double>
        Specified by:
        scale in interface Point2D<Double>
        Specified by:
        scale in interface Point2DLike<Double>
        Parameters:
        scale - The ratio in all directions to scale by.
        Returns:
        A new point that is the result of the scaling.
      • scale

        public Point2DDouble 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<Double>
        Specified by:
        scale in interface Point2D<Double>
        Specified by:
        scale in interface Point2DLike<Double>
        Parameters:
        scale - The ratio in all directions to scale by.
        Returns:
        A new point that is the result of the scaling.
      • scale

        public Point2DDouble 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<Double>
        Specified by:
        scale in interface Point2D<Double>
        Specified by:
        scale in interface Point2DLike<Double>
        Parameters:
        scale - The ratio in all directions to scale by.
        Returns:
        A new point that is the result of the scaling.
      • scale

        public Point2DDouble 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<Double>
        Specified by:
        scale in interface Point2D<Double>
        Specified by:
        scale in interface Point2DLike<Double>
        Parameters:
        scale - The ratio in all directions to scale by.
        Returns:
        A new point that is the result of the scaling.
      • scale

        public Point2DDouble 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<Double>
        Specified by:
        scale in interface Point2D<Double>
        Specified by:
        scale in interface Point2DLike<Double>
        Parameters:
        scale - The ratio in all directions to scale by.
        Returns:
        A new point that is the result of the scaling.
      • scale

        public Point2DDouble scale​(byte sx,
                                   byte sy)
        Description copied from interface: Point2D
        Scales this point by the given ratio.
        Specified by:
        scale in interface Point2D<Double>
        Parameters:
        sx - The ratio in x-direction to scale by.
        sy - The ratio in y-direction to scale by.
        Returns:
        A new point that is the result of the scaling.
      • scale

        public Point2DDouble scale​(short sx,
                                   short sy)
        Description copied from interface: Point2D
        Scales this point by the given ratio.
        Specified by:
        scale in interface Point2D<Double>
        Parameters:
        sx - The ratio in x-direction to scale by.
        sy - The ratio in y-direction to scale by.
        Returns:
        A new point that is the result of the scaling.
      • scale

        public Point2DDouble scale​(int sx,
                                   int sy)
        Description copied from interface: Point2D
        Scales this point by the given ratio.
        Specified by:
        scale in interface Point2D<Double>
        Parameters:
        sx - The ratio in x-direction to scale by.
        sy - The ratio in y-direction to scale by.
        Returns:
        A new point that is the result of the scaling.
      • scale

        public Point2DDouble scale​(long sx,
                                   long sy)
        Description copied from interface: Point2D
        Scales this point by the given ratio.
        Specified by:
        scale in interface Point2D<Double>
        Parameters:
        sx - The ratio in x-direction to scale by.
        sy - The ratio in y-direction to scale by.
        Returns:
        A new point that is the result of the scaling.
      • scale

        public Point2DDouble scale​(float sx,
                                   float sy)
        Description copied from interface: Point2D
        Scales this point by the given ratio.
        Specified by:
        scale in interface Point2D<Double>
        Parameters:
        sx - The ratio in x-direction to scale by.
        sy - The ratio in y-direction to scale by.
        Returns:
        A new point that is the result of the scaling.
      • scale

        public Point2DDouble scale​(double sx,
                                   double sy)
        Description copied from interface: Point2D
        Scales this point by the given ratio.
        Specified by:
        scale in interface Point2D<Double>
        Parameters:
        sx - The ratio in x-direction to scale by.
        sy - The ratio in y-direction to scale by.
        Returns:
        A new point that is the result of the scaling.
      • subtract

        public Point2DDouble subtract​(byte dx,
                                      byte dy)
        Description copied from interface: Point2D
        Subtracts a given amount from the coordinates of this point.
        Specified by:
        subtract in interface Point2D<Double>
        Parameters:
        dx - The delta in x-direction to subtract.
        dy - The delta in y-direction to subtract.
        Returns:
        A new point that is the result of the subtraction.
      • subtract

        public Point2DDouble subtract​(int dx,
                                      int dy)
        Description copied from interface: Point2D
        Subtracts a given amount from the coordinates of this point.
        Specified by:
        subtract in interface Point2D<Double>
        Parameters:
        dx - The delta in x-direction to subtract.
        dy - The delta in y-direction to subtract.
        Returns:
        A new point that is the result of the subtraction.
      • subtract

        public Point2DDouble subtract​(short dx,
                                      short dy)
        Description copied from interface: Point2D
        Subtracts a given amount from the coordinates of this point.
        Specified by:
        subtract in interface Point2D<Double>
        Parameters:
        dx - The delta in x-direction to subtract.
        dy - The delta in y-direction to subtract.
        Returns:
        A new point that is the result of the subtraction.
      • subtract

        public Point2DDouble subtract​(long dx,
                                      long dy)
        Description copied from interface: Point2D
        Subtracts a given amount from the coordinates of this point.
        Specified by:
        subtract in interface Point2D<Double>
        Parameters:
        dx - The delta in x-direction to subtract.
        dy - The delta in y-direction to subtract.
        Returns:
        A new point that is the result of the subtraction.
      • subtract

        public Point2DDouble subtract​(float dx,
                                      float dy)
        Description copied from interface: Point2D
        Subtracts a given amount from the coordinates of this point.
        Specified by:
        subtract in interface Point2D<Double>
        Parameters:
        dx - The delta in x-direction to subtract.
        dy - The delta in y-direction to subtract.
        Returns:
        A new point that is the result of the subtraction.
      • subtract

        public Point2DDouble subtract​(double dx,
                                      double dy)
        Description copied from interface: Point2D
        Subtracts a given amount from the coordinates of this point.
        Specified by:
        subtract in interface Point2D<Double>
        Parameters:
        dx - The delta in x-direction to subtract.
        dy - The delta in y-direction to subtract.
        Returns:
        A new point that is the result of the subtraction.
      • subtract

        public Point2DDouble subtract​(Point2DLike<?> delta)
        Description copied from interface: Point2D
        Subtracts the given point from this point.
        Specified by:
        subtract in interface Point2D<Double>
        Parameters:
        delta - The point to subtract.
        Returns:
        A new point that is the result of the subtraction.
      • translate

        public Point2DDouble translate​(Point2DLike<?> delta)
        Description copied from interface: Point2D
        Translates this point by the given delta.
        Specified by:
        translate in interface Point2D<Double>
        Parameters:
        delta - The delta to translate by.
        Returns:
        A new point that is the result of the translation.
      • translate

        public Point2DDouble translate​(byte dx,
                                       byte dy)
        Description copied from interface: Point2D
        Translates this point by the given delta.
        Specified by:
        translate in interface Point2D<Double>
        Parameters:
        dx - The delta in x-direction to translate by.
        dy - The delta in y-direction to translate by.
        Returns:
        A new point that is the result of the translation.
      • translate

        public Point2DDouble translate​(short dx,
                                       short dy)
        Description copied from interface: Point2D
        Translates this point by the given delta.
        Specified by:
        translate in interface Point2D<Double>
        Parameters:
        dx - The delta in x-direction to translate by.
        dy - The delta in y-direction to translate by.
        Returns:
        A new point that is the result of the translation.
      • translate

        public Point2DDouble translate​(int dx,
                                       int dy)
        Description copied from interface: Point2D
        Translates this point by the given delta.
        Specified by:
        translate in interface Point2D<Double>
        Parameters:
        dx - The delta in x-direction to translate by.
        dy - The delta in y-direction to translate by.
        Returns:
        A new point that is the result of the translation.
      • translate

        public Point2DDouble translate​(long dx,
                                       long dy)
        Description copied from interface: Point2D
        Translates this point by the given delta.
        Specified by:
        translate in interface Point2D<Double>
        Parameters:
        dx - The delta in x-direction to translate by.
        dy - The delta in y-direction to translate by.
        Returns:
        A new point that is the result of the translation.
      • translate

        public Point2DDouble translate​(float dx,
                                       float dy)
        Description copied from interface: Point2D
        Translates this point by the given delta.
        Specified by:
        translate in interface Point2D<Double>
        Parameters:
        dx - The delta in x-direction to translate by.
        dy - The delta in y-direction to translate by.
        Returns:
        A new point that is the result of the translation.
      • translate

        public Point2DDouble translate​(double dx,
                                       double dy)
        Description copied from interface: Point2D
        Translates this point by the given delta.
        Specified by:
        translate in interface Point2D<Double>
        Parameters:
        dx - The delta in x-direction to translate by.
        dy - The delta in y-direction to translate by.
        Returns:
        A new point that is the result of the translation.
      • x

        public Point2DDouble x​(Double 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<Double>
        Specified by:
        x in interface Point2D<Double>
        Specified by:
        x in interface Point2DLike<Double>
        Parameters:
        x - The new x coordinate value
        Returns:
        A point with the specified x coordinate.
      • x

        public Double x()
        Description copied from interface: Point1DLike
        The x coordinate of this point.
        Specified by:
        x in interface Point1DLike<Double>
        Returns:
        the x coordinate
      • xByte

        public Point2DDouble 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<Double>
        Specified by:
        xByte in interface Point2D<Double>
        Specified by:
        xByte in interface Point2DLike<Double>
        Parameters:
        x - The new x coordinate value as a byte
        Returns:
        A point with the specified x coordinate.
      • xDouble

        public Point2DDouble 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<Double>
        Specified by:
        xDouble in interface Point2D<Double>
        Specified by:
        xDouble in interface Point2DLike<Double>
        Parameters:
        x - The new x coordinate value as a double
        Returns:
        A point with the specified x coordinate.
      • xDouble

        public double xDouble()
        Description copied from interface: Point1DLike
        The x coordinate of this point.
        Specified by:
        xDouble in interface Point1DLike<Double>
        Returns:
        the x coordinate
      • xFloat

        public Point2DDouble 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<Double>
        Specified by:
        xFloat in interface Point2D<Double>
        Specified by:
        xFloat in interface Point2DLike<Double>
        Parameters:
        x - The new x coordinate value as a float
        Returns:
        A point with the specified x coordinate.
      • xInt

        public Point2DDouble 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<Double>
        Specified by:
        xInt in interface Point2D<Double>
        Specified by:
        xInt in interface Point2DLike<Double>
        Parameters:
        x - The new x coordinate value as an int
        Returns:
        A point with the specified x coordinate.
      • xLong

        public Point2DDouble 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<Double>
        Specified by:
        xLong in interface Point2D<Double>
        Specified by:
        xLong in interface Point2DLike<Double>
        Parameters:
        x - The new x coordinate value as a long
        Returns:
        A point with the specified x coordinate.
      • xShort

        public Point2DDouble 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<Double>
        Specified by:
        xShort in interface Point2D<Double>
        Specified by:
        xShort in interface Point2DLike<Double>
        Parameters:
        x - The new x coordinate value as a short
        Returns:
        A point with the specified x coordinate.
      • y

        public Point2DDouble y​(Double y)
        Description copied from interface: Point2DLike
        Returns a point with the y coordinate set to the given value, while keeping other coordinates unchanged.
        Specified by:
        y in interface Point2D<Double>
        Specified by:
        y in interface Point2DLike<Double>
        Parameters:
        y - The new y coordinate value
        Returns:
        A point with the specified y coordinate.
      • y

        public Double y()
        Description copied from interface: Point2DLike
        The y coordinate of this point.
        Specified by:
        y in interface Point2DLike<Double>
        Returns:
        the y coordinate
      • yByte

        public Point2DDouble yByte​(byte y)
        Description copied from interface: Point2DLike
        Returns a point with the y coordinate set to the given byte value, while keeping other coordinates unchanged.
        Specified by:
        yByte in interface Point2D<Double>
        Specified by:
        yByte in interface Point2DLike<Double>
        Parameters:
        y - The new y coordinate value as a byte
        Returns:
        A point with the specified y coordinate.
      • yDouble

        public Point2DDouble yDouble​(double y)
        Description copied from interface: Point2DLike
        Returns a point with the y coordinate set to the given double value, while keeping other coordinates unchanged.
        Specified by:
        yDouble in interface Point2D<Double>
        Specified by:
        yDouble in interface Point2DLike<Double>
        Parameters:
        y - The new y coordinate value as a double
        Returns:
        A point with the specified y coordinate.
      • yDouble

        public double yDouble()
        Description copied from interface: Point2DLike
        The y coordinate of this point, as a double.
        Specified by:
        yDouble in interface Point2DLike<Double>
        Returns:
        the y coordinate
      • yFloat

        public Point2DDouble yFloat​(float y)
        Description copied from interface: Point2DLike
        Returns a point with the y coordinate set to the given float value, while keeping other coordinates unchanged.
        Specified by:
        yFloat in interface Point2D<Double>
        Specified by:
        yFloat in interface Point2DLike<Double>
        Parameters:
        y - The new y coordinate value as a float
        Returns:
        A point with the specified y coordinate.
      • yInt

        public Point2DDouble yInt​(int y)
        Description copied from interface: Point2DLike
        Returns a point with the y coordinate set to the given int value, while keeping other coordinates unchanged.
        Specified by:
        yInt in interface Point2D<Double>
        Specified by:
        yInt in interface Point2DLike<Double>
        Parameters:
        y - The new y coordinate value as an int
        Returns:
        A point with the specified y coordinate.
      • yLong

        public Point2DDouble yLong​(long y)
        Description copied from interface: Point2DLike
        Returns a point with the y coordinate set to the given long value, while keeping other coordinates unchanged.
        Specified by:
        yLong in interface Point2D<Double>
        Specified by:
        yLong in interface Point2DLike<Double>
        Parameters:
        y - The new y coordinate value as a long
        Returns:
        A point with the specified y coordinate.
      • yShort

        public Point2DDouble yShort​(short y)
        Description copied from interface: Point2DLike
        Returns a point with the y coordinate set to the given short value, while keeping other coordinates unchanged.
        Specified by:
        yShort in interface Point2D<Double>
        Specified by:
        yShort in interface Point2DLike<Double>
        Parameters:
        y - The new y coordinate value as a short
        Returns:
        A point with the specified y coordinate.
      • unitDegrees

        public static Point2DDouble unitDegrees​(double degrees)
        Gets a unit vector pointing in the specified direction in degrees. 0 is east, 90 is north, 180 is west, and 270 is south.
        Parameters:
        degrees - The angle in degrees.
        Returns:
        A unit vector pointing in the specified direction.
      • unitRadians

        public static Point2DDouble unitRadians​(double radians)
        Gets a unit vector pointing in the specified direction in radians. 0 is east, π/2 is north, π is west, and 3π/2 is south.
        Parameters:
        radians - The angle in radians.
        Returns:
        A unit vector pointing in the specified direction.
      • unitXNegative

        public static Point2DDouble unitXNegative()
        Gets a unit vector pointing in the negative x-direction.
        Returns:
        A unit vector pointing in the negative x-direction.
      • unitXPositive

        public static Point2DDouble unitXPositive()
        Gets a unit vector pointing in the positive x-direction.
        Returns:
        A unit vector pointing in the positive x-direction.
      • unitYNegative

        public static Point2DDouble unitYNegative()
        Gets a unit vector pointing in the negative y-direction.
        Returns:
        A unit vector pointing in the negative y-direction.
      • unitYPositive

        public static Point2DDouble unitYPositive()
        Gets a unit vector pointing in the positive y-direction.
        Returns:
        A unit vector pointing in the positive y-direction.
      • zero

        public static Point2DDouble zero()
        Gets a point at the origin (0, 0).
        Returns:
        A point at the origin (0, 0).