83 return (x * x) + (y *
y) + (z * z);
130 void set(
double nx,
double ny,
double nz);
139 return v.
x == x && v.
y == y && v.
z ==
z;
143 return v.
x != x || v.
y != y || v.
z !=
z;
165 return x != 0 || y != 0 || z != 0;
177 x += radius * sin(theta) * cos(phi);
178 y += radius * sin(theta) * sin(phi);
179 z += radius * cos(theta);
192 x += intermediateRadius * sin(theta) * cos(phi);
193 y += intermediateRadius * sin(theta) * sin(phi);
194 z += intermediateRadius * cos(theta);
void MakeRandomPointOnSphereLayer(double radiusInner, double radiusOuter)
double MakeRandomFloat(double low, double high)
Generates random real from interval [low; high].
Vector3D & operator=(const Vector3D &v)
Vector3D(double nx, double ny, double nz)
Vector3D operator*(const Vector3D &v) const
Vector3D operator+(const Vector3D &v) const
void MakeRandomPointOnSphere(double radius)
bool operator!=(const Vector3D &v)
Vector3D & operator-=(const Vector3D &v)
void set(double nx, double ny, double nz)
Vector3D refraction(Vector3D norm, double fact) const
double lengthSquared() const
bool operator==(const Vector3D &v)
Vector3D(const Vector3D &v)
double dotProduct(const Vector3D &v) const
Vector3D reflection(Vector3D norm) const
Vector3D & operator/=(const Vector3D &v)
Vector3D operator/(const Vector3D &v) const
Vector3D operator-(const Vector3D &v) const
Vector3D crossProduct(const Vector3D &v) const
Vector3D & operator+=(const Vector3D &v)
Vector3D & operator*=(const Vector3D &v)