java.lang.Object | |
↳ | java.awt.geom.Point2D |
Known Direct Subclasses |
The Point2D
class defines a point representing a location
in (x,y)
coordinate space.
This class is only the abstract superclass for all objects that store a 2D coordinate. The actual storage representation of the coordinates is left to the subclass.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Point2D.Double | The Double class defines a point specified in
double precision. |
||||||||||
Point2D.Float | The Float class defines a point specified in float
precision. |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This is an abstract class that cannot be instantiated directly.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new object of the same class and with the
same contents as this object.
| |||||||||||
Returns the distance from this
Point2D to a
specified Point2D . | |||||||||||
Returns the distance between two points.
| |||||||||||
Returns the distance from this
Point2D to
a specified point. | |||||||||||
Returns the square of the distance from this
Point2D to a specified Point2D . | |||||||||||
Returns the square of the distance from this
Point2D to a specified point. | |||||||||||
Returns the square of the distance between two points.
| |||||||||||
Determines whether or not two points are equal.
| |||||||||||
Returns the X coordinate of this
Point2D in
double precision. | |||||||||||
Returns the Y coordinate of this
Point2D in
double precision. | |||||||||||
Returns the hashcode for this
Point2D . | |||||||||||
Sets the location of this
Point2D to the
specified double coordinates. | |||||||||||
Sets the location of this
Point2D to the same
coordinates as the specified Point2D object. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
This is an abstract class that cannot be instantiated directly. Type-specific implementation subclasses are available for instantiation and provide a number of formats for storing the information necessary to satisfy the various accessor methods below.
Creates a new object of the same class and with the same contents as this object.
OutOfMemoryError | if there is not enough memory. |
---|
Returns the distance from this Point2D
to a
specified Point2D
.
pt | the specified point to be measured
against this Point2D |
---|
Point2D
and
the specified Point2D
.Returns the distance between two points.
x1 | the X coordinate of the first specified point |
---|---|
y1 | the Y coordinate of the first specified point |
x2 | the X coordinate of the second specified point |
y2 | the Y coordinate of the second specified point |
Returns the distance from this Point2D
to
a specified point.
px | the X coordinate of the specified point to be measured
against this Point2D |
---|---|
py | the Y coordinate of the specified point to be measured
against this Point2D |
Point2D
and a specified point.Returns the square of the distance from this
Point2D
to a specified Point2D
.
pt | the specified point to be measured
against this Point2D |
---|
Point2D
to a specified Point2D
.Returns the square of the distance from this
Point2D
to a specified point.
px | the X coordinate of the specified point to be measured
against this Point2D |
---|---|
py | the Y coordinate of the specified point to be measured
against this Point2D |
Point2D
and the specified point.Returns the square of the distance between two points.
x1 | the X coordinate of the first specified point |
---|---|
y1 | the Y coordinate of the first specified point |
x2 | the X coordinate of the second specified point |
y2 | the Y coordinate of the second specified point |
Determines whether or not two points are equal. Two instances of
Point2D
are equal if the values of their
x
and y
member fields, representing
their position in the coordinate space, are the same.
obj | an object to be compared with this Point2D |
---|
true
if the object to be compared is
an instance of Point2D
and has
the same values; false
otherwise.Returns the X coordinate of this Point2D
in
double
precision.
Point2D
.Returns the Y coordinate of this Point2D
in
double
precision.
Point2D
.Returns the hashcode for this Point2D
.
Point2D
.
Sets the location of this Point2D
to the
specified double
coordinates.
x | the new X coordinate of this Point2D |
---|---|
y | the new Y coordinate of this Point2D |
Sets the location of this Point2D
to the same
coordinates as the specified Point2D
object.
p | the specified Point2D to which to set
this Point2D |
---|