java.lang.Object
uk.ac.leeds.ccg.v3d.core.V3D_Object
uk.ac.leeds.ccg.v3d.geometry.V3D_Geometry
uk.ac.leeds.ccg.v3d.geometry.V3D_Line
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
V3D_LineSegment
public class V3D_Line extends V3D_Geometry
3D representation of an infinite length line. The line passes through the
point
p and is travelling in the direction v.
- Vector Form
- (x,y,z) = (p.x,p.y,p.z) + t(v.dx,v.dy,v.dz)
- Parametric Form (where t describes a particular point on the line)
- x = p.x + t(v.dx)
- y = p.y + t(v.dy)
- z = p.z + t(v.dz)
- Symmetric Form (assume v.dx, v.dy, and v.dz are all nonzero)
- (x−p.x)/v.dx = (y−p.y)/v.dy = (z−p.z)/v.dz
- Version:
- 1.0
- Author:
- Andy Turner
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description booleanequals(java.lang.Object o)java.math.BigDecimalgetDistance(V3D_Line l, int scale, java.math.RoundingMode rm)V3D_GeometrygetIntersection(V3D_Line l)Intersectsthiswithl.static V3D_GeometrygetIntersection(V3D_Line l0, V3D_Line l1)inthashCode()booleanisIntersectedBy(V3D_Line l)This computes the intersection and tests if it isnullbooleanisIntersectedBy(V3D_Point pt)booleanisParallel(V3D_Line l)java.lang.StringtoString()
-
Field Details
-
Constructor Details
-
V3D_Line
- Parameters:
p- Whatpis set to.q- Whatqis set to.checkCoincidence- If true a check for coincidence ofpandqis done otherwise it is not done (as in the case when the line is a line segment defining the edge of an envelope which is allowed to be a point).- Throws:
java.lang.RuntimeException- Ifpandqare coincident andcheckCoincidenceistrue.
-
V3D_Line
pshould not be equal toqunless the line is a line segment which is part of an envelope. If unsure the useV3D_Line(V3D_Point, V3D_Point, boolean). -
V3D_Line
-
V3D_Line
- Parameters:
l- Vector_LineSegment3D
-
-
Method Details
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
isIntersectedBy
- Parameters:
pt- A point to test for intersection.- Returns:
trueif p is on the line.
-
isParallel
- Parameters:
l- The line to test this with to see if they are parallel.- Returns:
trueIf this andlare parallel.
-
isIntersectedBy
This computes the intersection and tests if it isnull- Parameters:
l- The line to test if it isIntersectedBy with this.- Returns:
trueIf this andlintersect.
-
getIntersection
Intersectsthiswithl. If they are equivalent then returnthis.- Parameters:
l- The line to get intersection with this.- Returns:
- The intersection between
thisandl.
-
getIntersection
-
getDistance
- Parameters:
l- A line.scale- The scale for the precision of the result.rm- The RoundingMode for any rounding.- Returns:
- The shortest distance between this and
l.
-