13 #ifndef _CS237_VEC2_HXX_
14 #define _CS237_VEC2_HXX_
17 #error "c237-vec2.hxx should not be included directly"
29 vec2 () : x(T(0)), y(T(0)) { }
31 explicit vec2 (T xx) : x(xx), y(T(0)) { }
32 explicit vec2 (T xx, T yy) : x(xx), y(yy) { }
39 T
const &
operator[] (
unsigned int const &i)
const;
72 std::ostream& operator<< (std::ostream& s, vec2<T>
const &v);
vec2 & operator/=(T const &s)
divide this vector by a scalar
Definition: cs237-vec2.inl:107
vec2()
Definition: cs237-vec2.hxx:29
vec2(T xx)
Definition: cs237-vec2.hxx:31
vec2 & normalize()
normalize the vector
Definition: cs237-vec2.inl:122
vec2 & operator*=(T const &s)
multiply this vector by a scalar
Definition: cs237-vec2.inl:91
T y
Definition: cs237-vec2.hxx:27
T x
Definition: cs237-vec2.hxx:27
vec2(T xx, T yy)
Definition: cs237-vec2.hxx:32
T & operator[](unsigned int const &i)
Definition: cs237-vec2.inl:36
__detail::vec2< double > vec2d
Two-element, double-precision floating-point vectors.
Definition: cs237-vec2.hxx:79
vec2 & operator=(vec2 const &v)
Definition: cs237-vec2.inl:50
template class for four-element vectors
Definition: cs237-types.hxx:27
vec2(vec2 const &v)
Definition: cs237-vec2.hxx:30
__detail::vec2< float > vec2f
Two-element, single-precision floating-point vectors.
Definition: cs237-vec2.hxx:77
vec2 & operator+=(T const &s)
add a scalar to this vector
Definition: cs237-vec2.inl:59
Definition: cs237-aabb.hxx:18
template class for three-element vectors
Definition: cs237-types.hxx:26
template class for two-element vectors
Definition: cs237-types.hxx:25
vec2 & operator-=(T const &s)
subtract a scalar from this vector
Definition: cs237-vec2.inl:75
T length() const
the length (magnitude) of the vector
Definition: cs237-vec2.inl:116