Pointpublic 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 double | distanceFromOrigin() // A method that operates on
return Math.sqrt(x*x + y*y); // the x and y fields
|
|