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 orthogonalStraight3Dthrough the givenVector3D.doubleReturns the clock-wise signed distance of the givenVector3Dto thisStraight3D.static Straight3DConstructs a newStraight3Dthrough the given start and endVector3Ds.Transfer thisStraight3Dinto a representativeStraight.
-
Method Details
-
through
Constructs a newStraight3Dthrough the given start and endVector3Ds.- Parameters:
start- The firstVector3Dwhich lies on to theStraight3Dwhich is constructed.end- The secondVector3Dwhich lies on theStraight3Dwhich is constructed.- Returns:
- a new
Straight3Dthrough start and endVector3Ds
-
getIntersection
Returns the intersection between this and the given otherStraight3D. The intersection is the cross product of bothVector3Ds.- Parameters:
other- TheStraight3Dfor which intersections are computed.- Returns:
- the intersection between this and the given other
Straight3D
-
getOrtho
- Returns:
- the orthogonal
Straight3Dthrough thisStraight3D's startVector3D
-
getOrtho
Returns the orthogonalStraight3Dthrough the givenVector3D.- Parameters:
vp- TheVector3Dwhich lies on the orthogonalStraight3D.- Returns:
- the orthogonal
Straight3Dthrough the givenVector3D
-
getSignedDistanceCW
Returns the clock-wise signed distance of the givenVector3Dto thisStraight3D. The clock-wise signed distance is the dot product of the bothVector3Ds divided by the length of the line's (x,y) vector:|(x,y)|.- Parameters:
vp- TheVector3Dto which the distance is computed.- Returns:
- the clock-wise signed distance of the
Vector3Dto thisStraight3D
-
toStraight
Transfer thisStraight3Dinto a representativeStraight.- Returns:
- a representative
Straight
-