All Packages Class Hierarchy This Package Previous Next Index
Class primitives.geomtry.Coordinate
java.lang.Object
|
+----primitives.geomtry.Coordinate
- public class Coordinate
- extends Object
The Coordinate
class represents a location in a
two-dimensional (x, y)as double
value coordinate space.
-
x
- The x coordinate.
-
y
- The y coordinate.
-
Coordinate()
- Constructs and initializes a Coordinate at the origin
(0, 0) of the coordinate space.
-
Coordinate(Coordinate)
- Constructs and initializes a coordinate with the same location as
the specified
Coordinate
object.
-
Coordinate(double, double)
- Constructs and initializes a coordinate at the specified
(x, y) location in the coordinate space.
-
Coordinate(Point)
- Constructs and initializes a coordinate with the same location as
the specified
Point
object.
-
move(Coordinate)
- Moves this coordinate to the same location as the
specified
Coordinate
object
-
move(double, double)
- Moves this point to the specificed location in the
(x, y) coordinate plane.
-
toPoint()
- Returns a representation of this coordinate and its location
in the (x, y) coordinate space as a Point object.
-
translate(double, double)
- Translates this coordinate, at location (x, y),
by
dx
along the x axis and dy
along the y axis so that it now represents the coordinate
(x
+
dx
,
y
+
dy
).
x
public double x
- The x coordinate.
y
public double y
- The y coordinate.
Coordinate
public Coordinate()
- Constructs and initializes a Coordinate at the origin
(0, 0) of the coordinate space.
Coordinate
public Coordinate(double x,
double y)
- Constructs and initializes a coordinate at the specified
(x, y) location in the coordinate space.
- Parameters:
- x - the x coordinate.
- y - the y coordinate.
Coordinate
public Coordinate(Coordinate coordinate)
- Constructs and initializes a coordinate with the same location as
the specified
Coordinate
object.
- Parameters:
- coordinate - a Coordinate.
Coordinate
public Coordinate(Point p)
- Constructs and initializes a coordinate with the same location as
the specified
Point
object.
- Parameters:
- p - a point.
move
public void move(double x,
double y)
- Moves this point to the specificed location in the
(x, y) coordinate plane. This method
is identical with
setLocation(double, double)
.
- Parameters:
- x - the x coordinate of the new location.
- y - the y coordinate of the new location.
move
public void move(Coordinate p)
- Moves this coordinate to the same location as the
specified
Coordinate
object
- Parameters:
- p - a coordinate.
translate
public void translate(double dx,
double dy)
- Translates this coordinate, at location (x, y),
by
dx
along the x axis and dy
along the y axis so that it now represents the coordinate
(x
+
dx
,
y
+
dy
).
- Parameters:
- dx - the distance to move this point
along the x axis.
- dy - the distance to move this point
toPoint
public ExtPoint toPoint()
- Returns a representation of this coordinate and its location
in the (x, y) coordinate space as a Point object.
the (x, y) are rounded to the nearest integer values.
- Returns:
- a Point representation of this Coordinate,
All Packages Class Hierarchy This Package Previous Next Index