physicon.graphLib
Class DoublePoint

java.lang.Object
  |
  +--physicon.graphLib.DoublePoint

public final class DoublePoint
extends java.lang.Object

The help class for the library. Represents the point with double coordinates x, y


Field Summary
 double x
           
 double y
           
 
Constructor Summary
DoublePoint()
          Constructor.
DoublePoint(double _x, double _y)
          Constructor.
DoublePoint(DoublePoint _dpt)
          Constructor
 
Method Summary
 boolean equals(DoublePoint _dpt)
          Compares two DoublePoints.
 double length()
          Returns the distance from the current point to the reference point (0, 0).
 void move(double _x, double _y)
          Moves the current object to another location.
 void move(DoublePoint _dpt)
          Moves the current object to the new location
 java.lang.String toString()
          Returns string representation of this double point.
 void translate(double _dx, double _dy)
          Translates the current object to the given vector
 void translate(DoublePoint _dpt)
          Translates the current object to the given vector
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public double x

y

public double y
Constructor Detail

DoublePoint

public DoublePoint()
Constructor.

DoublePoint

public DoublePoint(double _x,
                   double _y)
Constructor.
Parameters:
_x - - the x coordinate of the point
_y - - the y coordinate of the point

DoublePoint

public DoublePoint(DoublePoint _dpt)
Constructor
Parameters:
_dpt - - the point to copy coordinates from
Method Detail

equals

public boolean equals(DoublePoint _dpt)
Compares two DoublePoints. Two DoublePoints are equals each other if they have similar coordinates.
Parameters:
_dpt - - the DoublePoint which is to be compared with the current object

move

public void move(double _x,
                 double _y)
Moves the current object to another location.
Parameters:
_x - - new x coordinate of the current object
_y - - new y coordinate of the current object

move

public void move(DoublePoint _dpt)
Moves the current object to the new location
Parameters:
_dpt - - the DoublePoint with new coordinates of the current object

translate

public void translate(double _dx,
                      double _dy)
Translates the current object to the given vector
Parameters:
_dx - - shift in the x coordinate of the current object
_dy - - shift in the y coordinate of the current object

translate

public void translate(DoublePoint _dpt)
Translates the current object to the given vector
Parameters:
_dpt - - the vector of translation. its coordinates will be added to the coordinates of current object

length

public double length()
Returns the distance from the current point to the reference point (0, 0).

toString

public java.lang.String toString()
Returns string representation of this double point.
Overrides:
toString in class java.lang.Object