public static class Point2D.Float extends Point2D
float
precision.Point2D.Double, Point2D.Float
Modifier and Type | Field and Description |
---|---|
float |
x
The X coordinate.
|
float |
y
The Y coordinate.
|
Constructor and Description |
---|
Point2D.Float()
Create a new point at (0,0).
|
Point2D.Float(float x,
float y)
Create a new point at (x,y).
|
Modifier and Type | Method and Description |
---|---|
double |
getX()
Return the x coordinate.
|
double |
getY()
Return the y coordinate.
|
void |
setLocation(double x,
double y)
Sets the location of this point.
|
void |
setLocation(float x,
float y)
Sets the location of this point.
|
String |
toString()
Returns a string representation of this object.
|
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, hashCode, setLocation
public Point2D.Float()
public Point2D.Float(float x, float y)
x
- the x coordinatey
- the y coordinatepublic double getX()
public double getY()
public void setLocation(double x, double y)
setLocation
in class Point2D
x
- the new x coordinatey
- the new y coordinatepublic void setLocation(float x, float y)
x
- the new x coordinatey
- the new y coordinatepublic String toString()
"Point2D.Float[" + x + ", " + y + ']'
.toString
in class Object
Object.getClass()
,
Object.hashCode()
,
Class.getName()
,
Integer.toHexString(int)