| 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
target value endValue, double fraction between t)0.0 and 1.0Implements javafx. The function calculates an interpolated value along the fraction
|
| 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. The function calculates an interpolated value along the fraction
| |
| 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
| |