jApp
Class Point2d

java.lang.Object
  extended by jApp.Point2d
All Implemented Interfaces:
java.io.Serializable

public final class Point2d
extends java.lang.Object
implements java.io.Serializable

Implements a 2D point with double precision coordinates. This is very similar to Point2D.Double in java.awt.geom package. The excistence of this class and especially the package (xApp) it resides in is a historical accident. In the future this class will be emigrated to the 'myjapp' package once a viable imigration stategy has been thought out.

IMPORTANT NOTICE

Serialization of instances of this class is strongly discouraged, as changing the package will inevitably break compatibility of serialized objects.

Author:
nyholku
See Also:
Serialized Form

Field Summary
 double x
           
 double y
           
 
Constructor Summary
Point2d()
           
Point2d(double x, double y)
           
Point2d(Point2d p)
           
Point2d(java.awt.geom.Point2D p)
           
 
Method Summary
 Point2d add(Point2d p)
           
 java.awt.geom.Point2D.Double asPoint2D()
           
 double distance_sqr(Point2d p)
           
 double distance(Point2d p)
           
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 double length()
           
 Point2d negate()
           
 Point2d scale(double s)
           
 Point2d substract(Point2d p)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public double x

y

public double y
Constructor Detail

Point2d

public Point2d()

Point2d

public Point2d(double x,
               double y)

Point2d

public Point2d(java.awt.geom.Point2D p)

Point2d

public Point2d(Point2d p)
Method Detail

negate

public Point2d negate()

add

public Point2d add(Point2d p)

substract

public Point2d substract(Point2d p)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

length

public double length()

distance

public double distance(Point2d p)

distance_sqr

public double distance_sqr(Point2d p)

asPoint2D

public java.awt.geom.Point2D.Double asPoint2D()

scale

public Point2d scale(double s)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object