An instance of data type Vector_d<Kernel> is a vector of Euclidean space in dimension . A vector can be represented in homogeneous coordinates of number type RT, such that which is of type FT. We call the 's the Cartesian coordinates of the vector. The homogenizing coordinate is positive.
This data type is meant for use in computational geometry. It realizes free vectors as opposed to position vectors (type Point_d). The main difference between position vectors and free vectors is their behavior under affine transformations, e.g., free vectors are invariant under translations.
| |
the ring type.
| |
| |
the field type.
| |
| |
the linear algebra layer.
| |
| |
a read-only iterator for the
Cartesian coordinates.
| |
| |
a read-only iterator for the
homogeneous coordinates.
| |
| |
construction tag.
|
| |
introduces a variable v
of type Vector_d<Kernel>.
| |
| |
introduces the zero
vector v of type Vector_d<Kernel> in -dimensional space.
For the creation flag CGAL::NULL_VECTOR can be used.
| |
| |
| |
introduces a variable
v of type Vector_d<Kernel> in dimension d. If
size [first,last) == d this creates a vector with Cartesian
coordinates set [first,last). If size [first,last) == p+1 the range specifies the homogeneous coordinates where the
sign chosen is the sign of . Precondition: d is nonnegative, [first,last) has d or d+1 elements where the last has to be non-zero. Requirement: The value type of InputIterator is RT.
| |
| |
| |
introduces a
variable v of type Vector_d<Kernel> in dimension d
initialized to the vector with homogeneous coordinates as defined by
H = set [first,last) and D: . The sign
chosen is the sign of . Precondition: D is non-zero, the iterator range defines a -tuple of RT. Requirement: The value type of InputIterator is RT.
| |
| |
returns a
variable v of type Vector_d<Kernel> initialized to the -th
base vector of dimension . Precondition: .
| |
| |
introduces a
variable v of type Vector_d<Kernel> in -dimensional space. Precondition: .
| |
| |
introduces a
variable v of type Vector_d<Kernel> in -dimensional space. Precondition: .
|
|
| returns the dimension of v. |
|
| |
returns the -th Cartesian
coordinate of v. Precondition: . | ||
|
|
returns the -th Cartesian
coordinate of v. Precondition: . |
|
| |
returns the -th homogeneous
coordinate of v. Precondition: . | ||
|
| |
returns the square of the length of v. | ||
| ||
| ||
returns an iterator pointing to the zeroth Cartesian coordinate of v. | ||
| ||
| returns an iterator pointing beyond the last Cartesian coordinate of v. | |
| ||
| ||
returns an iterator pointing to the zeroth homogeneous coordinate of v. | ||
| ||
| ||
returns an iterator pointing beyond the last homogeneous coordinate of v. | ||
| ||
| returns the direction of v. | |
|
| |
returns . |
|
| multiplies all Cartesian coordinates by n. |
|
| multiplies all Cartesian coordinates by r. |
|
| returns the vector with Cartesian coordinates . |
|
| returns the vector with Cartesian coordinates . |
|
| divides all Cartesian coordinates by n. |
|
| divides all Cartesian coordinates by r. |
|
| inner product, i.e., , where and are the Cartesian coordinates of and respectively. |
|
| returns the vector with Cartesian coordinates . |
|
| addition plus assignment. |
|
| returns the vector with Cartesian coordinates . |
|
| subtraction plus assignment. |
|
| returns the vector in opposite direction. |
|
| returns true if v is the zero vector. |
|
| returns the vector with Cartesian coordinates . |
|
| returns the vector with Cartesian coordinates . |
Vectors are implemented by arrays of variables of type RT. All operations like creation, initialization, tests, vector arithmetic, input and output on a vector take time . coordinate access, dimension() and conversions take constant time. The space requirement of a vector is .