|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcynosurex.graphics2D.Line2D
public class Line2D
A line represented in 2D coordination space, e.g. (x, y).
Field Summary | |
---|---|
protected Point2D |
p1
|
protected Point2D |
p2
|
Fields inherited from interface cynosurex.internal.CommonInterface |
---|
copyright, copyrightYears, notice, program, version |
Fields inherited from interface cynosurex.internal.AuthorCommon |
---|
author, copyrightSymbol, noticeMsg, rights |
Fields inherited from interface cynosurex.internal.CompanyCommon |
---|
company, email, website |
Constructor Summary | |
---|---|
Line2D(double x1,
double y1,
double x2,
double y2)
Constructs and initializes a Line2D from the specified point coordinates. |
|
Line2D(Point2D p1,
Point2D p2)
Constructs and initializes a Line2D from the specified points. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Checks whether two pointers are equal. |
Point2D |
getMidpoint()
Returns the midpoint of the line |
double |
getSlope()
Returns the slope of the line. |
Point2D |
getXIntercept()
Returns the x-intercept of the line. |
Point2D |
getYIntercept()
Returns the y-intercept of the line. |
int |
hashCode()
Returns the hashcode for this Line2D. |
java.lang.String |
toString()
Returns the String representation of this Point's coordinates. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Point2D p1
protected Point2D p2
Constructor Detail |
---|
public Line2D(double x1, double y1, double x2, double y2)
x1
- the x coordinate of the first pointy1
- the y coordinate of the first pointx2
- the x coordinate of the second pointy2
- the y coordinate of the second pointpublic Line2D(Point2D p1, Point2D p2)
p1
- the first pointp2
- the second pointMethod Detail |
---|
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public Point2D getMidpoint()
public double getSlope()
public Point2D getXIntercept()
public Point2D getYIntercept()
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |