Documentation
¶
Overview ¶
Package line implements a 1D line in N-dimensional ambient space.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type L ¶
type L struct {
// contains filtered or unexported fields
}
L defines a parametric line of the form
L := P + tD
func (L) L ¶
L calculates the vector value on the line which corresponds to the input parametric t-value.
func (L) Parallel ¶ added in v0.5.0
Parallel checks if two lines are parallel. A return value of false may indicate the lines intersect, are skew lines, or are anti-parallel.
We check for the parallel property by examining the ratio of the vector directions.
See https://stackoverflow.com/a/45181059/873865 for more details.
func (L) T ¶
T calculates the projected t-value of v onto l by finding the point on L closest to v.
Intuitively, we want to find the magnitude of the projected leg onto L; that is, we care about
||v - P||
Therefore, we need a factor of ||D|| in the denominator.
Furthermore, we know that t grows linearly with ||D||, so we need to add another ||D|| factor in the denominator as a normalization factor.