Provides work with segment. It is a point-size pair, where size is a direction vector.
alias Vector!(3,T,"x y z") vectype
vectype pnt
- start of segmentvectype dir
- size and direction
ref vectype start()
- return ref to pntref const(vectype) start()
- return copy of pntvectype end() const
- return sum of pnt and dirvectype end( in vectype p )
- sets end point and return itSegment!T revert() const
- swap start and endT len2() const
- return squared length of dirT len() const
- return length of dir
static Segment!T fromPoints( in vectype start, in vectype end )
seg+seg
seg-seg
seg*double
seg/double
implements by mixin( BasicMathOp!"pnt dir" )
-
Segment!T tr(X)( in Matrix!(4,4,X) mtr )
- apply transform matrix to copy and return it -
Segment!T altitude( in vectype pp )
- altitude from segment line to point -
Segment!T altitude(F)( in Segment!F seg )
- altitude fromthis
segment line toseg
line -
vectype intersect(F)( in Segment!F seg )
- point of intersection of segments lines as altitude pnt + dir * 0.5