FileDocCategorySizeDatePackage
Point.javaAPI DocExample431Wed Apr 20 14:43:54 BST 2005None

Point

public class Point extends Object
Represents a Cartesian (x,y) point

Fields Summary
public double
x
public double
y
Constructors Summary
public Point(double x, double y)

     // A constructor that
         this.x = x; this.y = y;            // initializes the fields
     
Methods Summary
public doubledistanceFromOrigin()

   // A method that operates on
         return Math.sqrt(x*x + y*y);       // the x and y fields