5 #ifndef __IRR_POINT_2D_H_INCLUDED__
6 #define __IRR_POINT_2D_H_INCLUDED__
68 bool operator<=(const vector2d<T>&other)
const
82 bool operator<(const vector2d<T>&other)
const
126 return X*other.X +
Y*other.Y;
154 const f64 cs = cos(degrees);
155 const f64 sn = sin(degrees);
160 set((T)(
X*cs -
Y*sn), (T)(
X*sn +
Y*cs));
188 return X < 0 ? 180 : 0;
191 return Y < 0 ? 270 : 90;
211 return X < 0 ? 180 : 0;
213 return Y < 0 ? 90 : 270;
251 return atan(sqrt(1 - tmp*tmp) / tmp) *
RADTODEG64;
261 if (begin.X != end.X)
263 return ((begin.X <=
X &&
X <= end.X) ||
264 (begin.X >=
X &&
X >= end.X));
268 return ((begin.Y <=
Y &&
Y <= end.Y) ||
269 (begin.Y >=
Y &&
Y >= end.Y));
281 return vector2d<T>((T)(other.X*inv +
X*d), (T)(other.Y*inv +
Y*d));
293 const f64 inv = 1.0f - d;
294 const f64 mul0 = inv * inv;
295 const f64 mul1 = 2.0f * d * inv;
296 const f64 mul2 = d * d;
298 return vector2d<T> ( (T)(
X * mul0 + v2.X * mul1 + v3.X * mul2),
299 (T)(
Y * mul0 + v2.Y * mul1 + v3.Y * mul2));
310 X = (T)((
f64)b.X + ( ( a.X - b.X ) * d ));
311 Y = (T)((
f64)b.Y + ( ( a.Y - b.Y ) * d ));
328 template<
class S,
class T>