33 double& operator [](
int);
34 const double& operator [](
int)
const;
63 double lengthSquared()
const;
66 void copyTo(
float [2])
const;
67 void copyTo(
double [2])
const;
88 v_[0] = v.
v_[0]; v_[1] = v.
v_[1];
100 assert(i == 0 || i == 1);
106 assert(i == 0 || i == 1);
114 v_[0] = x; v_[1] = y;
120 v_[0] = v[0]; v_[1] = v[1];
128 v_[0] += v[0]; v_[1] += v[1];
134 v_[0] -= v[0]; v_[1] -= v[1];
140 v_[0] *= c; v_[1] *= c;
147 v_[0] /= c; v_[1] /= c;
153 return gmVector2(v_[0] + v[0], v_[1] + v[1]);
158 return gmVector2(v_[0] - v[0], v_[1] - v[1]);
189 return (!(*
this == v));
220 f[0] = v_[0]; f[1] = v_[1];
225 f[0] = v_[0]; f[1] = v_[1];
230 return sqrt(
gmSqr(v1[0] - v2[0]) +
gmSqr(v1[1] - v2[1]));
235 return gmSqr(v1[0] - v2[0]) +
gmSqr(v1[1] - v2[1]);
240 return v1[0] * v2[0] + v1[1] * v2[1];
245 return v1 + ((v2 - v1) * f);
252 os <<
"< " << v[0] <<
" " << v[1] <<
" >";