103 float dot(
const vec3& p)
const;
166 void scale(
float sx,
float sy,
float sz);
void scale(float sx, float sy, float sz)
internal scaling (similar to componentwise)
Definition: vec3.cpp:290
float internal_x
x coordinate
Definition: vec3.hpp:190
float dot(const vec3 &p) const
perform dot product between two v3
Definition: vec3.cpp:118
vec3 operator+(const vec3 &p2) const
operator
Definition: vec3.cpp:140
float x() const
get x coordinate
Definition: vec3.cpp:38
vec3 operator*(float s) const
multiply by a scalar operator
Definition: vec3.cpp:179
vec2 to_vec2() const
convert to v2 (x,y)
Definition: vec3.cpp:297
float z() const
get z coordinate
Definition: vec3.cpp:58
vec3 operator/(float s) const
divide by a scalar operator
Definition: vec3.cpp:186
vec3 operator-() const
unary negation
Definition: vec3.cpp:243
vec3 product_compontentwise(const vec3 &p) const
does componentwise mutliplication
Definition: vec3.cpp:248
vec3 & operator+=(const vec3 &p)
internal +
Definition: vec3.cpp:195
matrix1x4 operator-(float s, const matrix1x4 &m)
operator
Definition: matrix1x4.cpp:82
matrix1x4 operator+(float s, const matrix1x4 &m)
operator
Definition: matrix1x4.cpp:61
float norm2() const
get the square norm of the vector
Definition: vec3.cpp:128
float internal_z
z coordinate
Definition: vec3.hpp:194
vec3 & operator-=(const vec3 &p)
internal -
Definition: vec3.cpp:211
void set_zero()
set every entry to 0
Definition: vec3.cpp:111
vec3 & product_compontentwise_internal(const vec3 &p)
does componentwise mutliplication
Definition: vec3.cpp:253
float internal_y
y coordinate
Definition: vec3.hpp:192
float operator[](const size_t &k) const
Access to the k_th entry (k in [0,2])
Definition: vec3.cpp:68
std::string to_string() const
export the value as string cout<<v3(2,3,6) => 2 3 6
Definition: vec3.cpp:260
float y() const
get y coordinate
Definition: vec3.cpp:48
matrix1x4 operator*(float s, const matrix1x4 &m)
multiply by a scalar operator
Definition: matrix1x4.cpp:93
std::ostream & operator<<(std::ostream &stream, const matrix1x4 &_m)
output the vector in ostream
Definition: matrix1x4.cpp:182
Vectors/Points 2D.
Definition: vec2.hpp:34
float norm() const
get the norm of the vector
Definition: vec3.cpp:123
vec3()
empty constructor
Definition: vec3.cpp:36
vec3 & operator/=(float s)
internal /
Definition: vec3.cpp:235
Vectors/Points 3D.
Definition: vec3.hpp:36
vec3 & operator*=(float s)
internal *
Definition: vec3.cpp:227
vec3 cross(const vec3 &p) const
compute cross product with an other vector
Definition: vec3.cpp:133
float operator()(const size_t &k) const
Access to the k_th entry (k in [0,2])
Definition: vec3.cpp:102
vec3 normalized() const
normalize the vector to unit length
Definition: vec3.cpp:281
const float * pointer() const
fast pointer access
Definition: vec3.cpp:299
void assert_size(const size_t &k) const
assert that a size_t belongs to [[0,2]]
Definition: vec3.cpp:272