public class PointD
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
double |
x
The public x coordinate.
|
double |
y
The public y coordinate
|
Constructor and Description |
---|
PointD()
Constructs a PointD at (0, 0).
|
PointD(double x,
double y)
Constructs a PointD with given coordintes.
|
PointD(turtle.GGVector v)
Constructs a PointD from given GGVector
|
PointD(android.graphics.Point pt)
Constructs a PointD from given Point
|
PointD(PointD pt)
Constructs a PointD from given PointD
|
PointD(android.graphics.PointF pt)
Constructs a PointD from given PointF
|
Modifier and Type | Method and Description |
---|---|
PointD |
clone()
Returns a new PointD with duplicated coordinates.
|
boolean |
equals(java.lang.Object obj)
Checks whether the x-y-coordinates of the given PointD
are equal to the x-y-coordinates of the current PointD
(overrides Object.equals()).
|
double |
getX()
Gets the x coordinate
|
double |
getY()
Gets the y coordinate
|
void |
set(double x,
double y)
Sets the coordinates to given values.
|
void |
set(PointD pt)
Sets the coordinates to coordinates of given PointD.
|
void |
set(android.graphics.PointF pt)
Sets the coordinates to coordinates of given PointF.
|
java.lang.String |
toString() |
public PointD()
public PointD(double x, double y)
x
- the x coordinatey
- the y coordinatepublic PointD(android.graphics.PointF pt)
pt
- the PointF where to take the coordinatespublic PointD(android.graphics.Point pt)
pt
- the Point where to take the coordinatespublic PointD(turtle.GGVector v)
v
- the GGVector where to take the coordinatespublic PointD(PointD pt)
pt
- the PointD where to take the x and y coordinatespublic void set(double x, double y)
x
- the new x coordinatey
- the ney y coordinatepublic void set(android.graphics.PointF pt)
pt
- the PointF from where to copy the coordinatespublic void set(PointD pt)
pt
- the PointD from where to copy the coordinatespublic double getX()
public double getY()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object whose coordinates are checkedpublic PointD clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object