Class Straight3D
- java.lang.Object
-
- org.eclipse.gef.geometry.projective.Straight3D
-
public final class Straight3D extends java.lang.ObjectA 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
Vector3Dwhich represents aPointwith a third, homogeneous coordinate.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Vector3DgetIntersection(Straight3D other)Returns the intersection between this and the given otherStraight3D.Straight3DgetOrtho()Straight3DgetOrtho(Vector3D vp)Returns the orthogonalStraight3Dthrough the givenVector3D.doublegetSignedDistanceCW(Vector3D vp)Returns the clock-wise signed distance of the givenVector3Dto thisStraight3D.static Straight3Dthrough(Vector3D start, Vector3D end)Constructs a newStraight3Dthrough the given start and endVector3Ds.StraighttoStraight()Transfer thisStraight3Dinto a representativeStraight.
-
-
-
Method Detail
-
through
public static Straight3D through(Vector3D start, Vector3D end)
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
public Vector3D getIntersection(Straight3D other)
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
public Straight3D getOrtho()
- Returns:
- the orthogonal
Straight3Dthrough thisStraight3D's startVector3D
-
getOrtho
public Straight3D getOrtho(Vector3D vp)
Returns the orthogonalStraight3Dthrough the givenVector3D.- Parameters:
vp- TheVector3Dwhich lies on the orthogonalStraight3D.- Returns:
- the orthogonal
Straight3Dthrough the givenVector3D
-
getSignedDistanceCW
public double getSignedDistanceCW(Vector3D vp)
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
public Straight toStraight()
Transfer thisStraight3Dinto a representativeStraight.- Returns:
- a representative
Straight
-
-