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 (xy)as double value coordinate space.


Variable Index

 o x
The x coordinate.
 o y
The y coordinate.

Constructor Index

 o Coordinate()
Constructs and initializes a Coordinate at the origin (0, 0) of the coordinate space.
 o Coordinate(Coordinate)
Constructs and initializes a coordinate with the same location as the specified Coordinate object.
 o Coordinate(double, double)
Constructs and initializes a coordinate at the specified (xy) location in the coordinate space.
 o Coordinate(Point)
Constructs and initializes a coordinate with the same location as the specified Point object.

Method Index

 o move(Coordinate)
Moves this coordinate to the same location as the specified Coordinate object
 o move(double, double)
Moves this point to the specificed location in the (xy) coordinate plane.
 o toPoint()
Returns a representation of this coordinate and its location in the (xy) coordinate space as a Point object.
 o translate(double, double)
Translates this coordinate, at location (xy), by dx along the x axis and dy along the y axis so that it now represents the coordinate (x + dx, y + dy).

Variables

 o x
 public double x
The x coordinate.

 o y
 public double y
The y coordinate.

Constructors

 o Coordinate
 public Coordinate()
Constructs and initializes a Coordinate at the origin (0, 0) of the coordinate space.

 o Coordinate
 public Coordinate(double x,
                   double y)
Constructs and initializes a coordinate at the specified (xy) location in the coordinate space.

Parameters:
x - the x coordinate.
y - the y coordinate.
 o Coordinate
 public Coordinate(Coordinate coordinate)
Constructs and initializes a coordinate with the same location as the specified Coordinate object.

Parameters:
coordinate - a Coordinate.
 o Coordinate
 public Coordinate(Point p)
Constructs and initializes a coordinate with the same location as the specified Point object.

Parameters:
p - a point.

Methods

 o move
 public void move(double x,
                  double y)
Moves this point to the specificed location in the (xy) 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.
 o move
 public void move(Coordinate p)
Moves this coordinate to the same location as the specified Coordinate object

Parameters:
p - a coordinate.
 o translate
 public void translate(double dx,
                       double dy)
Translates this coordinate, at location (xy), 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
 o toPoint
 public ExtPoint toPoint()
Returns a representation of this coordinate and its location in the (xy) coordinate space as a Point object. the (xy) are rounded to the nearest integer values.

Returns:
a Point representation of this Coordinate,

All Packages  Class Hierarchy  This Package  Previous  Next  Index