|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcz.cuni.utils.math.extended.Segment2D
public class Segment2D
Contains hash code + method equals (endpoints of the segment must be the same, ordering doesn't metter), once created - shouldn't be changed.
| Field Summary | |
|---|---|
Vertex2D[] |
ab
Endpoints of the segment. |
Vertex2D[] |
abN
Normalized order of vertices a,b |
protected int |
hashCode
|
double |
length
|
Line2D |
line
Line in which segment lies. |
| Constructor Summary | |
|---|---|
Segment2D(Vertex2D a,
Vertex2D b)
|
|
| Method Summary | |
|---|---|
protected int |
countHashCode()
|
boolean |
equals(java.lang.Object o)
|
boolean |
equals(Segment2D s)
|
Vertex2D |
getOtherVertex(Vertex2D previousVertex)
|
int |
hashCode()
|
boolean |
hasVertex(Vertex2D v)
Wether v is one of the endpoint of this segment. |
double |
length()
|
Tuple2D[] |
segmentPoints(Tuple2D point,
double distance)
Returns points which distance from 'point' is 'distance' and lies inside the segment. |
Vertex2D |
sharedVertex(Segment2D s)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public Line2D line
public Vertex2D[] ab
public Vertex2D[] abN
public double length
protected final int hashCode
| Constructor Detail |
|---|
public Segment2D(Vertex2D a,
Vertex2D b)
| Method Detail |
|---|
protected int countHashCode()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic boolean equals(Segment2D s)
public Tuple2D[] segmentPoints(Tuple2D point,
double distance)
point - ... must be part of the segment's line!distance - public int hashCode()
hashCode in class java.lang.Objectpublic double length()
public boolean hasVertex(Vertex2D v)
public Vertex2D getOtherVertex(Vertex2D previousVertex)
public Vertex2D sharedVertex(Segment2D s)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||