public class Point2D
extends java.lang.Object
| Constructor and Description |
|---|
Point2D(double x,
double y) |
| Modifier and Type | Method and Description |
|---|---|
Point2D |
add(double value)
Add the given value to the point.
|
Point2D |
add(double x,
double y)
Add the given values to the point.
|
Point2D |
add(Point2D point)
Add the values of the given point to this point.
|
double |
distance(double x,
double y)
Calculate the distance between this point and the given point.
|
double |
distance(Point2D point)
Calculate the distance between this point and the given point.
|
double |
distanceSquared(double x,
double y)
Calculate the square distance between this point and the given point.
|
double |
distanceSquared(Point2D point)
Calculate the square distance between this point and the given point.
|
Point2D |
divide(double value)
Divide the point by the given value.
|
Point2D |
divide(double x,
double y)
Divide the point by the given values.
|
Point2D |
divide(Point2D point)
Divide this point by the values of the given point.
|
double |
getX() |
double |
getY() |
Point2D |
multiply(double value)
Multiply the point with the given value.
|
Point2D |
multiply(double x,
double y)
Multiply the point with the given values.
|
Point2D |
multiply(Point2D point)
Multiply the values of the given point with this point.
|
Point2D |
subtract(double value)
Subtract the given value from the point.
|
Point2D |
subtract(double x,
double y)
Subtract the given values from the point.
|
Point2D |
subtract(Point2D point)
Subtract the values of the given point from this point.
|
public double getX()
public double getY()
public Point2D add(double value)
value - The value to addpublic Point2D add(double x, double y)
x - The x value to addy - The y value to addpublic Point2D add(Point2D point)
point - The point to addpublic Point2D subtract(double value)
value - The value to subtractpublic Point2D subtract(double x, double y)
x - The x value to subtracty - The y value to subtractpublic Point2D subtract(Point2D point)
point - The point to subtractpublic Point2D multiply(double value)
value - The value to multiplypublic Point2D multiply(double x, double y)
x - The x value to multiplyy - The y value to multiplypublic Point2D multiply(Point2D point)
point - The point to multiplypublic Point2D divide(double value)
value - The value to dividepublic Point2D divide(double x, double y)
x - The x value to dividey - The y value to dividepublic Point2D divide(Point2D point)
point - The point to dividepublic double distanceSquared(double x,
double y)
x - The x coordinate of the pointy - The y coordinate of the pointpublic double distanceSquared(Point2D point)
point - The point to calculate the distance topublic double distance(double x,
double y)
x - The x coordinate of the pointy - The y coordinate of the pointpublic double distance(Point2D point)
point - The point to calculate the distance to