Class Straight3D
java.lang.Object
org.eclipse.gef.geometry.projective.Straight3D
A two-dimensional infinite line that is defined by three coordinates of which
the third is a so called homogeneous coordinate. Calculations are easier to
do on such lines:
- the point of intersection between two lines is the cross product of their respective three dimensional vectors
- the distance from a point to the line is the scalar product of both three dimensional vectors
This is the complement to the Vector3D
which represents a
Point
with a third, homogeneous coordinate.
-
Method Summary
Modifier and TypeMethodDescriptiongetIntersection
(Straight3D other) Returns the intersection between this and the given otherStraight3D
.getOrtho()
Returns the orthogonalStraight3D
through the givenVector3D
.double
Returns the clock-wise signed distance of the givenVector3D
to thisStraight3D
.static Straight3D
Constructs a newStraight3D
through the given start and endVector3D
s.Transfer thisStraight3D
into a representativeStraight
.
-
Method Details
-
through
Constructs a newStraight3D
through the given start and endVector3D
s.- Parameters:
start
- The firstVector3D
which lies on to theStraight3D
which is constructed.end
- The secondVector3D
which lies on theStraight3D
which is constructed.- Returns:
- a new
Straight3D
through start and endVector3D
s
-
getIntersection
Returns the intersection between this and the given otherStraight3D
. The intersection is the cross product of bothVector3D
s.- Parameters:
other
- TheStraight3D
for which intersections are computed.- Returns:
- the intersection between this and the given other
Straight3D
-
getOrtho
- Returns:
- the orthogonal
Straight3D
through thisStraight3D
's startVector3D
-
getOrtho
Returns the orthogonalStraight3D
through the givenVector3D
.- Parameters:
vp
- TheVector3D
which lies on the orthogonalStraight3D
.- Returns:
- the orthogonal
Straight3D
through the givenVector3D
-
getSignedDistanceCW
Returns the clock-wise signed distance of the givenVector3D
to thisStraight3D
. The clock-wise signed distance is the dot product of the bothVector3D
s divided by the length of the line's (x,y) vector:|(x,y)|
.- Parameters:
vp
- TheVector3D
to which the distance is computed.- Returns:
- the clock-wise signed distance of the
Vector3D
to thisStraight3D
-
toStraight
Transfer thisStraight3D
into a representativeStraight
.- Returns:
- a representative
Straight
-