All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cynosurex.graphics2D.Line2D

java.lang.Object
   |
   +----cynosurex.graphics2D.Line2D

public class Line2D
extends Object
implements CommonInterface
A line represented in 2D coordination space, e.g. (x, y).


Variable Index

 o p1
 o p2

Constructor Index

 o Line2D(double, double, double, double)
Constructs and initializes a Line2D from the specified point coordinates.
 o Line2D(Point2D, Point2D)
Constructs and initializes a Line2D from the specified points.

Method Index

 o equals(Object)
Checks whether two pointers are equal.
 o getMidpoint()
Returns the midpoint of the line
 o getSlope()
Returns the slope of the line.
 o getXIntercept()
Returns the x-intercept of the line.
 o getYIntercept()
Returns the y-intercept of the line.
 o hashCode()
Returns the hashcode for this Line2D.
 o toString()
Returns the String representation of this Point's coordinates.

Variables

 o p1
 protected Point2D p1
 o p2
 protected Point2D p2

Constructors

 o Line2D
 public Line2D(double x1,
               double y1,
               double x2,
               double y2)
Constructs and initializes a Line2D from the specified point coordinates.

Parameters:
x1 - the x coordinate of the first point
y1 - the y coordinate of the first point
x2 - the x coordinate of the second point
y2 - the y coordinate of the second point
 o Line2D
 public Line2D(Point2D p1,
               Point2D p2)
Constructs and initializes a Line2D from the specified points.

Parameters:
p1 - the first point
p2 - the second point

Methods

 o equals
 public boolean equals(Object obj)
Checks whether two pointers are equal.

Overrides:
equals in class Object
 o getMidpoint
 public Point2D getMidpoint()
Returns the midpoint of the line

 o getSlope
 public double getSlope()
Returns the slope of the line.

 o getXIntercept
 public Point2D getXIntercept()
Returns the x-intercept of the line.

 o getYIntercept
 public Point2D getYIntercept()
Returns the y-intercept of the line.

 o hashCode
 public int hashCode()
Returns the hashcode for this Line2D.

Overrides:
hashCode in class Object
 o toString
 public String toString()
Returns the String representation of this Point's coordinates.

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index