An instance of data type Vector_d<Kernel> is a vector of Euclidean space in dimension $$d. A vector $$r = (r_{0},...,r_{ d  1}) can be represented in homogeneous coordinates $$(h_{0},...,h_{d}) of number type RT, such that $$r_{i} = h_{i}/h_{d} which is of type FT. We call the $$r_{i}'s the Cartesian coordinates of the vector. The homogenizing coordinate $$h_{d} 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 readonly iterator for the
Cartesian coordinates.
 
 
a readonly 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 $$ddimensional 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 $$H = set [first,last) = ( ± h_{0}, ± h_{1}, ..., ± h_{d}) where the
sign chosen is the sign of $$h_{d}. Precondition: d is nonnegative, [first,last) has d or d+1 elements where the last has to be nonzero. 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: $$( ± H[0],
± H[1], ..., ± H[d1], ± D). The sign
chosen is the sign of $$D. Precondition: D is nonzero, the iterator range defines a $$dtuple of RT. Requirement: The value type of InputIterator is RT.
 
 
returns a
variable v of type Vector_d<Kernel> initialized to the $$ith
base vector of dimension $$d. Precondition: $$0 i < d.
 
 
introduces a
variable v of type Vector_d<Kernel> in $$2dimensional space. Precondition: $$w 0.
 
 
introduces a
variable v of type Vector_d<Kernel> in $$3dimensional space. Precondition: $$w 0.


 returns the dimension of v. 

 
returns the $$ith Cartesian
coordinate of v. Precondition: $$0 i < d.  


returns the $$ith Cartesian
coordinate of v. Precondition: $$0 i < d. 

 
returns the $$ith homogeneous
coordinate of v. Precondition: $$0 i d.  

 
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 $$t(v). 

 multiplies all Cartesian coordinates by n. 

 multiplies all Cartesian coordinates by r. 

 returns the vector with Cartesian coordinates $$v_{i}/n, 0 i < d. 

 returns the vector with Cartesian coordinates $$v_{i}/r, 0 i < d. 

 divides all Cartesian coordinates by n. 

 divides all Cartesian coordinates by r. 

 inner product, i.e., $$ _{ 0 i < d } v_{i} w_{i}, where $$v_{i} and $$w_{i} are the Cartesian coordinates of $$v and $$w respectively. 

 returns the vector with Cartesian coordinates $$v_{i}+w_{i}, 0 i < d. 

 addition plus assignment. 

 returns the vector with Cartesian coordinates $$v_{i}w_{i}, 0 i < d. 

 subtraction plus assignment. 

 returns the vector in opposite direction. 

 returns true if v is the zero vector. 

 returns the vector with Cartesian coordinates $$n v_{i}. 

 returns the vector with Cartesian coordinates $$r v_{i}, 0 i < d. 
Vectors are implemented by arrays of variables of type RT. All operations like creation, initialization, tests, vector arithmetic, input and output on a vector $$v take time $$O(v.dimension()). coordinate access, dimension() and conversions take constant time. The space requirement of a vector is $$O(v.dimension()).