| Modifier and Type | Field and Description |
|---|---|
| private int | hash
Cache the hash code to make computing hashes faster. |
| private final double | x
The x coordinate. |
| private final double | y
The y coordinate. |
| public static final Point2D | ZERO
Point or vector with both coordinates set to 0. |
| Access | Constructor and Description |
|---|---|
| public | Point2D(double
the x coordinate of the point x, double the y coordinate of the point y)Creates a new instance of |
| Modifier and Type | Method and Description |
|---|---|
| public Point2D | Returns: the point with added coordinatesthe X coordinate addition x, double the Y coordinate addition y)Returns a point with the specified coordinates added to the coordinates of this point. |
| public Point2D | |
| public double | Returns: the angle between the two vectors measured in degreesthe X magnitude of the other vector x, double the Y magnitude of the other vector y)Computes the angle (in degrees) between the vector represented by this point and the specified vector. |
| public double | |
| public double | |
| public Point3D | Returns: the cross product of the two vectorsthe X magnitude of the other vector x, double the Y magnitude of the other vector y)Computes cross product of the vector represented by this instance and the specified vector. |
| public Point3D | Returns: the cross product of the two vectorsthe other vector vector)Computes cross product of the vector represented by this instance and the specified vector. |
| public double | Returns: the distance between this point and point(x1, y1).the x coordinate of other point x1, double the y coordinate of other point y1)Computes the distance between this point and point |
| public double | |
| public double | Returns: the dot product of the two vectorsthe X magnitude of the other vector x, double the Y magnitude of the other vector y)Computes dot (scalar) product of the vector represented by this instance and the specified vector. |
| public double | Returns: the dot product of the two vectorsthe other vector vector)Computes dot (scalar) product of the vector represented by this instance and the specified vector. |
| public boolean | Returns: true if this point is the same as the obj argument; false otherwisethe reference object with which to compare obj)Overrides java. Indicates whether some other object is "equal to" this one. |
| public final double | |
| public final double | |
| public int | Returns: a hash code value for the point.Overrides java. Returns a hash code value for the point. |
| public Point2D | interpolate(Point2D
the target value endValue, double the interpolation factor t)Implements javafx. Returns an intermediate value between the value of this |
| public double | Returns: magnitude of the vectorComputes magnitude (length) of the relative magnitude vector represented by this instance. |
| public Point2D | Returns: the point in the middlethe X coordinate of the second endpoint x, double the Y coordinate of the second endpoint y)Returns a point which lies in the middle between this point and the specified coordinates. |
| public Point2D | |
| public Point2D | Returns: the point with multiplied coordinatesthe factor multiplying the coordinates factor)Returns a point with the coordinates of this point multiplied by the specified factor |
| public Point2D | Returns: the normalized vector represented by aPoint2D instanceNormalizes the relative magnitude vector represented by this instance. |
| public Point2D | Returns: the point with subtracted coordinatesthe X coordinate subtraction x, double the Y coordinate subtraction y)Returns a point with the specified coordinates subtracted from the coordinates of this point. |
| public Point2D | |
| public String |
| hash | back to summary |
|---|---|
| private int hash Cache the hash code to make computing hashes faster. | |
| x | back to summary |
|---|---|
| private final double x The x coordinate.
| |
| y | back to summary |
|---|---|
| private final double y The y coordinate.
| |
| ZERO | back to summary |
|---|---|
| public static final Point2D ZERO Point or vector with both coordinates set to 0. | |
| Point2D | back to summary |
|---|---|
| public Point2D(double x, double y) Creates a new instance of
| |
| add | back to summary |
|---|---|
| public Point2D add(double x, double y) Returns a point with the specified coordinates added to the coordinates of this point.
| |
| add | back to summary |
|---|---|
| public Point2D add(Point2D point) Returns a point with the coordinates of the specified point added to the coordinates of this point.
| |
| angle | back to summary |
|---|---|
| public double angle(double x, double y) Computes the angle (in degrees) between the vector represented by this point and the specified vector.
| |
| angle | back to summary |
|---|---|
| public double angle(Point2D point) Computes the angle (in degrees) between the vector represented by this point and the vector represented by the specified point.
| |
| angle | back to summary |
|---|---|
| public double angle(Point2D p1, Point2D p2) Computes the angle (in degrees) between the three points with this point as a vertex.
| |
| crossProduct | back to summary |
|---|---|
| public Point3D crossProduct(double x, double y) Computes cross product of the vector represented by this instance and the specified vector.
| |
| crossProduct | back to summary |
|---|---|
| public Point3D crossProduct(Point2D vector) Computes cross product of the vector represented by this instance and the specified vector.
| |
| distance | back to summary |
|---|---|
| public double distance(double x1, double y1) Computes the distance between this point and point
| |
| distance | back to summary |
|---|---|
| public double distance(Point2D point) Computes the distance between this point and the specified
| |
| dotProduct | back to summary |
|---|---|
| public double dotProduct(double x, double y) Computes dot (scalar) product of the vector represented by this instance and the specified vector.
| |
| dotProduct | back to summary |
|---|---|
| public double dotProduct(Point2D vector) Computes dot (scalar) product of the vector represented by this instance and the specified vector.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Indicates whether some other object is "equal to" this one. | |
| getX | back to summary |
|---|---|
| public final double getX() The x coordinate.
| |
| getY | back to summary |
|---|---|
| public final double getY() The y coordinate.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns a hash code value for the point.
| |
| interpolate | back to summary |
|---|---|
| public Point2D interpolate(Point2D endValue, double t) Implements javafx. Doc from javafx. Returns an intermediate value between the value of this The returned value might not be a new instance; the implementation might also return one of the two existing instances if the intermediate value would be equal to one of the existing values. However, this is an optimization and applications should not assume any particular identity of the returned value.
| |
| magnitude | back to summary |
|---|---|
| public double magnitude() Computes magnitude (length) of the relative magnitude vector represented by this instance.
| |
| midpoint | back to summary |
|---|---|
| public Point2D midpoint(double x, double y) Returns a point which lies in the middle between this point and the specified coordinates.
| |
| midpoint | back to summary |
|---|---|
| public Point2D midpoint(Point2D point) Returns a point which lies in the middle between this point and the specified point.
| |
| multiply | back to summary |
|---|---|
| public Point2D multiply(double factor) Returns a point with the coordinates of this point multiplied by the specified factor
| |
| normalize | back to summary |
|---|---|
| public Point2D normalize() Normalizes the relative magnitude vector represented by this instance. Returns a vector with the same direction and magnitude equal to 1. If this is a zero vector, a zero vector is returned.
| |
| subtract | back to summary |
|---|---|
| public Point2D subtract(double x, double y) Returns a point with the specified coordinates subtracted from the coordinates of this point.
| |
| subtract | back to summary |
|---|---|
| public Point2D subtract(Point2D point) Returns a point with the coordinates of the specified point subtracted from the coordinates of this point.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation of this
| |