public class Point extends java.lang.Object implements java.lang.Comparable<Point>, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
double |
x
The x coordinate of this point.
|
double |
y
The y coordinate of this point.
|
| Constructor and Description |
|---|
Point(double x,
double y) |
public final double x
public final double y
public Point(double x,
double y)
x - the x coordinate of this point.y - the y coordinate of this point.public int compareTo(Point point)
compareTo in interface java.lang.Comparable<Point>public double distance(Point point)
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic Point offset(double dx, double dy)
public java.lang.String toString()
toString in class java.lang.Object