A Direction_d is a vector in the d-dimensional vector space where we forget about its length. We represent directions in d-dimensional space as a tuple (h0, ,hd) of variables of type RT which we call the homogeneous coordinates of the direction. The coordinate hd must be positive. The Cartesian coordinates of a direction are ci = hi/hd for 0 ≤ i < d, which are of type FT. Two directions are equal if their Cartesian coordinates are positive multiples of each other. Directions are in one-to-one correspondence to points on the unit sphere.
| |
the linear algebra layer.
| |
| |
a read-only iterator for the deltas of dir.
| |
| |
construction tag.
|
| |||||
introduces a variable dir of
type Direction_d<Kernel>.
| |||||
| |||||
introduces a variable dir of type Direction_d<Kernel>
initialized to the direction of v.
| |||||
| |||||
| |||||
introduces a variable dir of type Direction_d<Kernel> in
dimension d with representation tuple set [first,last).
| |||||
| |||||
returns
a variable dir of type Direction_d<Kernel> initialized to the
direction of the i-th base vector of dimension d.
| |||||
| |||||
introduces a variable dir of type Direction_d<Kernel> in
2-dimensional space.
| |||||
| |||||
introduces a variable dir of type Direction_d<Kernel> in
3-dimensional space.
|
|
| returns the dimension of dir. | ||
|
|
returns the i-th component of dir.
| ||
|
|
returns the i-th delta of dir.
| ||
|
| returns an iterator pointing to the first delta of dir. | ||
|
| returns an iterator pointing beyond the last delta of dir. | ||
|
| returns a vector pointing in direction dir. | ||
|
| returns true iff dir.delta(i)==0 for all 0 ≤ i < d. | ||
|
| |||
returns t(p). | ||||
|
| returns the direction opposite to dir. | ||
|
| returns the direction opposite to dir. |
Directions are implemented by arrays of integers as an item type. All operations like creation, initialization, tests, inversion, input and output on a direction d take time O(d.dimension()). dimension(), coordinate access and conversion take constant time. The space requirement is O(d.dimension()).