Class Straight3D
- java.lang.Object
-
- org.eclipse.gef.geometry.projective.Straight3D
-
public final class Straight3D extends java.lang.Object
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 aPoint
with a third, homogeneous coordinate.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Vector3D
getIntersection(Straight3D other)
Returns the intersection between this and the given otherStraight3D
.Straight3D
getOrtho()
Straight3D
getOrtho(Vector3D vp)
Returns the orthogonalStraight3D
through the givenVector3D
.double
getSignedDistanceCW(Vector3D vp)
Returns the clock-wise signed distance of the givenVector3D
to thisStraight3D
.static Straight3D
through(Vector3D start, Vector3D end)
Constructs a newStraight3D
through the given start and endVector3D
s.Straight
toStraight()
Transfer thisStraight3D
into a representativeStraight
.
-
-
-
Method Detail
-
through
public static Straight3D through(Vector3D start, Vector3D end)
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
public Vector3D getIntersection(Straight3D other)
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
public Straight3D getOrtho()
- Returns:
- the orthogonal
Straight3D
through thisStraight3D
's startVector3D
-
getOrtho
public Straight3D getOrtho(Vector3D vp)
Returns the orthogonalStraight3D
through the givenVector3D
.- Parameters:
vp
- TheVector3D
which lies on the orthogonalStraight3D
.- Returns:
- the orthogonal
Straight3D
through the givenVector3D
-
getSignedDistanceCW
public double getSignedDistanceCW(Vector3D vp)
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
public Straight toStraight()
Transfer thisStraight3D
into a representativeStraight
.- Returns:
- a representative
Straight
-
-