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).
-
p1
-
-
p2
-
-
Line2D(double, double, double, double)
- Constructs and initializes a Line2D from the specified
point coordinates.
-
Line2D(Point2D, Point2D)
- Constructs and initializes a Line2D from the specified
points.
-
equals(Object)
- Checks whether two pointers are equal.
-
getMidpoint()
- Returns the midpoint of the line
-
getSlope()
- Returns the slope of the line.
-
getXIntercept()
- Returns the x-intercept of the line.
-
getYIntercept()
- Returns the y-intercept of the line.
-
hashCode()
- Returns the hashcode for this Line2D.
-
toString()
- Returns the String representation of this Point's coordinates.
p1
protected Point2D p1
p2
protected Point2D p2
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
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
equals
public boolean equals(Object obj)
- Checks whether two pointers are equal.
- Overrides:
- equals in class Object
getMidpoint
public Point2D getMidpoint()
- Returns the midpoint of the line
getSlope
public double getSlope()
- Returns the slope of the line.
getXIntercept
public Point2D getXIntercept()
- Returns the x-intercept of the line.
getYIntercept
public Point2D getYIntercept()
- Returns the y-intercept of the line.
hashCode
public int hashCode()
- Returns the hashcode for this Line2D.
- Overrides:
- hashCode in class Object
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