16 template <
int DIM,
typename T>
17 class NVec :
public vector<T>
24 for(
int i =0;
i<DIM;
i++)
25 this->push_back(v[
i]);
28 NVec(T t1,...): vector<T>(DIM)
32 va_start( marker, t1);
33 for(
int i =1;
i<DIM;
i++)
34 this->push_back((T) va_arg( marker, T));
40 NVec(T t1, T t2, T t3, T t4):vector<T>(DIM)
42 (*this)[0] = t1;(*this)[1] = t2;
43 (*this)[2] = t3;(*this)[3] = t4;
45 NVec(T t1, T t2, T t3):vector<T>(DIM)
47 (*this)[0] = t1;(*this)[1] = t2;(*this)[2] = t3;
49 NVec(T t1, T t2):vector<T>(DIM)
51 (*this)[0] = t1;(*this)[1] = t2;
61 va_start( marker, t1);
62 for(
int i =1;
i<DIM;
i++)
63 this->push_back((T) va_arg( marker, T));
69 for(
int i=0;
i<DIM;
i++)
75 template<
int DIM,
typename T>
76 inline ostream &operator<<(ostream &out, const NVec<DIM,T>&
v)
79 for(
int i =0;
i<DIM-1;
i++) out <<
v[
i] <<
" ";
85 template<
int DIM,
typename T>
88 for(
int i =0;i<DIM;i++) in >> v[
i];
92 template<
int DIM,
typename T>
95 for(
int i =0;
i<DIM;
i++)
96 if (v1[
i] != v2[
i])
return false;
103 template<
int DIM,
typename T>
107 for(
int i=0;
i<DIM;
i++)
112 template<
int DIM,
typename T>
115 for(
int i=0;
i<DIM;
i++)
121 template<
int DIM,
typename T>
125 for(
int i=0;
i<DIM;
i++)
133 for(
int i=0;
i<DIM;
i++)
138 template<
int DIM,
class T,
class N>
142 for(
int i=0;
i<DIM;
i++)
147 template<
int DIM,
class T,
class N>
151 template<
int DIM,
class T,
class N>
155 for(
int i=0;
i<DIM;
i++)
160 template<
int DIM,
class T,
class N>
163 for(
int i=0;
i<DIM;
i++)
168 template<
int DIM,
typename T>
172 for(
int i=0;
i<DIM;
i++)
188 -u[0]*v[2] + v[0]*u[2],
189 u[0]*v[1] - v[0]*u[1] );
200 if( l!=1.0 && l!=0.0 ) v /=
sqrt(l);
204 {
return norm(v-u); }
206 template<
int DIM,
typename T>
212 template<
int DIM,
typename T>
NVec< DIM, T > & operator()(T t1,...)
NVec< DIM, T > & operator=(T s)
T euclid_distance(const NVec< DIM, T > &u, const NVec< DIM, T > &v)
CGAL_END_NAMESPACE CGAL_BEGIN_NAMESPACE bool operator==(const Origin &o, const Point_2< R > &p)
Vector_3< T > operator*(T t, const Vector_3< T > &v)
NVec< 3, T > cross(const NVec< 3, T > &u, const NVec< 3, T > &v)
NVec(T t1, T t2, T t3, T t4)
NVec< 2, unsigned int > IdxHEdge
NVec< 2, float > TexCoord
Iterator_from_circulator< C, Ref, Ptr > operator+(Dist n, const Iterator_from_circulator< C, Ref, Ptr > &circ)
T norm(const NVec< DIM, T > &v)
NVec< 3, unsigned int > Tri
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
NVec< DIM, T > operator/=(NVec< DIM, T > &v, N s)
T norm2(const NVec< DIM, T > &v)
void unitize(NVec< DIM, T > &v)
NVec< 3, double > Vector3D
NVec< 3, double > Vertex3D
double angle(Vector_3< double > v1, Vector_3< double > v2)
Compute the angle between two vectors.
NVec< DIM, T > operator+=(NVec< DIM, T > &u, const NVec< DIM, T > &v)
NVec< 4, float > rgbColor
NVec< 3, double > Normal3D
CImg< _cimg_Tfloat > acos(const CImg< T > &instance)
Vector_n operator/(const Array_n_const &v1, Real a)
Point_2< R > operator-(const Origin &o, const Vector_2< R > &v)
NVec< 3, unsigned int > Quad
T angle_unitized(const NVec< DIM, T > &u, const NVec< DIM, T > &v)
NVec< 3, double > Point3D