27 const float pi = float(acos(-1.0
f));
49 mplier = 1.0f / mplier;
64 mplier = 1.0f / mplier;
66 return Vector3f(
i * mplier,
j * mplier,
k * mplier);
82 const float xy_mag = float(sqrt(pow(
i, 2) + pow(
j, 2)));
95 j = float(
sin(theta)) *
i;
96 i *= float(
cos(theta));
Vector3f & normalize()
Normalize the vector.
void set_spherical(const float &theta, const float &phi, const float &magnitude=1)
Set the vector using spherical coordinates.
const float sqrt_three
sqrt(3.0f)
std::istream & unserialize(std::istream &is, Color &value)
std::ostream & serialize(std::ostream &os, const Color &value)
float magnitude() const
Get the magnitude of the vector.
const Vector3f vector_k(0, 0, 1)
k == Vector3f(0, 0, 1)
const float sqrt_two
sqrt(2.0f)
A Featureful 3-Space Vector Class.
const float pi
pi == 3.1415926...
float theta() const
theta == radians north of vector i
Vector3f(const bool °enerate_=false)
The best way to create a Vector3f.
const float pi_over_two
pi/23
EGLSurface EGLint void ** value
float phi() const
phi == radians down from k
const Vector3f vector_i(1, 0, 0)
i == Vector3f(1, 0, 0)
const float three_pi_over_two
3*pi/2
const Vector3f vector_j(0, 1, 0)
j == Vector3f(0, 1, 0)
const float over_three
1/3
Vector3f normalized() const
Get the normalized vector.