30 Vec3D(
float x0 = 0.0f,
float y0 = 0.0f,
float z0 = 0.0f) : x(x0), y(y0), z(z0) {}
55 return x*v.
x + y*v.
y + z*v.
z;
106 return std::sqrt(x*x+y*y+z*z);
124 in >> v.
x >> v.
y >> v.
z;
130 out << v.
x <<
" " << v.
y <<
" " << v.
z;
146 Vec2D(
float x0 = 0.0f,
float y0 = 0.0f) : x(x0), y(y0) {}
170 return x*v.
x + y*v.
y;
212 return std::sqrt(x*x+y*y);
241 inline void rotate(
float x0,
float y0,
float *
x,
float *
y,
float angle)
243 float xa = *x - x0, ya = *y - y0;
244 *x = xa*cosf(angle) - ya*sinf(angle) + x0;
245 *y = xa*sinf(angle) + ya*cosf(angle) + y0;
float operator*(const Vec2D &v) const
Definition: vec3d.h:168
float x
Definition: vec3d.h:28
float length() const
Definition: vec3d.h:104
Vec3D operator-(const Vec3D &v) const
Definition: vec3d.h:47
Vec2D & operator=(const Vec2D &v)
Definition: vec3d.h:150
Vec3D operator+(const Vec3D &v) const
Definition: vec3d.h:41
Vec3D & operator=(const Vec3D &v)
Definition: vec3d.h:34
Vec2D operator~() const
Definition: vec3d.h:221
Vec3D operator%(const Vec3D &v) const
Definition: vec3d.h:69
float length() const
Definition: vec3d.h:210
Vec3D & operator+=(const Vec3D &v)
Definition: vec3d.h:75
Vec2D & operator+=(const Vec2D &v)
Definition: vec3d.h:184
Vec2D & operator*=(float d)
Definition: vec3d.h:198
Vec3D(float x0=0.0f, float y0=0.0f, float z0=0.0f)
Definition: vec3d.h:30
friend std::ostream & operator<<(std::ostream &out, const Vec3D &v)
Definition: vec3d.h:128
float x
Definition: vec3d.h:144
float lengthSquared() const
Definition: vec3d.h:99
float y
Definition: vec3d.h:144
float lengthSquared() const
Definition: vec3d.h:205
G3D::int16 y
Definition: Vector2int16.h:38
Vec2D(float x0=0.0f, float y0=0.0f)
Definition: vec3d.h:146
Vec3D & normalize()
Definition: vec3d.h:109
Vec3D & operator*=(float d)
Definition: vec3d.h:91
friend std::istream & operator>>(std::istream &in, Vec3D &v)
Definition: vec3d.h:122
Vec2D operator+(const Vec2D &v) const
Definition: vec3d.h:156
float z
Definition: vec3d.h:28
float y
Definition: vec3d.h:28
Vec3D & operator-=(const Vec3D &v)
Definition: vec3d.h:83
friend std::istream & operator>>(std::istream &in, Vec2D &v)
Definition: vec3d.h:229
Vec2D & normalize()
Definition: vec3d.h:215
float operator*(const Vec3D &v) const
Definition: vec3d.h:53
void rotate(float x0, float y0, float *x, float *y, float angle)
Definition: vec3d.h:241
G3D::int16 x
Definition: Vector2int16.h:37
Vec3D operator~() const
Definition: vec3d.h:115
Vec3D(const Vec3D &v)
Definition: vec3d.h:32
Vec2D & operator-=(const Vec2D &v)
Definition: vec3d.h:191
Vec2D(const Vec2D &v)
Definition: vec3d.h:148
Vec2D operator-(const Vec2D &v) const
Definition: vec3d.h:162