|
Eclipse Draw2d 3.8.0.201206011245 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.draw2d.geometry.Straight
public class Straight
Represents a straight line within 2-dimensional Euclidean space.
Field Summary | |
---|---|
Vector |
direction
direction vector of this straight |
Vector |
position
position vector of this straight |
Constructor Summary | |
---|---|
Straight(PrecisionPoint point1,
PrecisionPoint point2)
Constructs a new Straight between the two given Points. |
|
Straight(Vector position,
Vector direction)
Constructs a new Straight with the given position and direction. |
Method Summary | |
---|---|
boolean |
contains(Vector vector)
Calculates whether the point indicated by the provided Vector is a point on this Straight. |
boolean |
containsWithinSegment(Vector segmentStart,
Vector segmentEnd,
Vector vector)
Calculates whether the point indicated by the provided Vector is a point on the straight segment between the given start and end points. |
boolean |
equals(Object other)
Checks whether this Straight is equal to the provided Straight. |
double |
getAngle(Straight other)
Returns the (smallest) angle between this Straight and the provided one. |
double |
getDistance(Vector vector)
Returns the distance of the provided Vector to this Straight, which is the distance between the provided Vector and its projection onto this Straight. |
Vector |
getIntersection(Straight other)
Computes the intersection point of this Straight and the provided one, if it exists. |
Vector |
getProjection(Vector vector)
Returns the projection of the given Vector onto this Straight, which is the point on this Straight with the minimal distance to the point, denoted by the provided Vector. |
int |
hashCode()
|
boolean |
intersects(Straight other)
Checks whether this Straight and the provided one have an intersection point. |
boolean |
intersectsWithinSegment(Vector segmentStart,
Vector segmentEnd,
Straight other)
Checks whether this Straight and the provided one have an intersection point, which is inside the specified segment between segmentStart and segmentEnd. |
boolean |
isParallelTo(Straight other)
Checks whether this Straight and the provided one are parallel to each other. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public Vector position
public Vector direction
Constructor Detail |
---|
public Straight(Vector position, Vector direction)
position
- direction
- public Straight(PrecisionPoint point1, PrecisionPoint point2)
point1
- a first waypoint of the Straight to be constructedpoint2
- a second waypoint of the Straight to be constructedMethod Detail |
---|
public boolean intersects(Straight other)
other
- The Straight to use for the calculation.
public boolean intersectsWithinSegment(Vector segmentStart, Vector segmentEnd, Straight other)
segmentEnd
- a Vector indicating the end point of the segment. Has to be a
point on the straight.other
- the Straight to test
public Vector getIntersection(Straight other)
other
- The Straight to use for calculations.
public double getAngle(Straight other)
other
- The Straight to be used for the calculation.
public Vector getProjection(Vector vector)
vector
- The Vector whose projection should be determined.
public double getDistance(Vector vector)
vector
- The Vector whose distance is to be calculated.
public boolean contains(Vector vector)
vector
- the Vector who has to be checked.
public boolean containsWithinSegment(Vector segmentStart, Vector segmentEnd, Vector vector)
segmentStart
- a Vector indicating the start point of the segment. Has to be
a point on the straight.segmentEnd
- a Vector indicating the end point of the segment. Has to be a
point on the straight.vector
- the Vector who has to be checked.
public boolean isParallelTo(Straight other)
other
- The Straight to test for parallelism.
public boolean equals(Object other)
equals
in class Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public String toString()
toString
in class Object
Object.toString()
|
Eclipse Draw2d 3.8.0.201206011245 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |