49 vec4(
float x,
float y,
float z,
float w);
110 float dot(
const vec4& p)
const;
171 void scale(
float sx,
float sy,
float sz,
float sw);
vec4 operator/(float s) const
divide by a scalar operator
Definition: vec4.cpp:192
float w() const
get w coordinate
Definition: vec4.cpp:66
vec4()
empty constructor
Definition: vec4.cpp:35
vec4 & product_compontentwise_internal(const vec4 &p)
does componentwise mutliplication
Definition: vec4.cpp:269
float x() const
get x coordinate
Definition: vec4.cpp:37
void scale(float sx, float sy, float sz, float sw)
internal scaling (similar to componentwise)
Definition: vec4.cpp:307
float internal_z
z coordinate
Definition: vec4.hpp:199
float internal_x
x coordinate
Definition: vec4.hpp:195
vec4 & operator-=(const vec4 &p)
internal -
Definition: vec4.cpp:218
vec3 to_vec3() const
convert to v3 (x,y,z)
Definition: vec4.cpp:315
matrix1x4 operator-(float s, const matrix1x4 &m)
operator
Definition: matrix1x4.cpp:82
float norm() const
get the norm of the vector
Definition: vec4.cpp:137
matrix1x4 operator+(float s, const matrix1x4 &m)
operator
Definition: matrix1x4.cpp:61
float operator()(const size_t &k) const
Access to the k_th entry (k in [0,3])
Definition: vec4.cpp:114
float y() const
get y coordinate
Definition: vec4.cpp:47
const float * pointer() const
fast pointer access
Definition: vec4.cpp:318
vec4 & operator/=(float s)
internal /
Definition: vec4.cpp:246
vec4 operator+(const vec4 &p2) const
operator
Definition: vec4.cpp:148
vec4 product_compontentwise(const vec4 &p) const
does componentwise mutliplication
Definition: vec4.cpp:264
float internal_y
y coordinate
Definition: vec4.hpp:197
float operator[](const size_t &k) const
Access to the k_th entry (k in [0,3])
Definition: vec4.cpp:76
vec2 to_vec2() const
convert to v2 (x,y)
Definition: vec4.cpp:316
matrix1x4 operator*(float s, const matrix1x4 &m)
multiply by a scalar operator
Definition: matrix1x4.cpp:93
void assert_size(const size_t &k) const
assert that a size_t belongs to [[0,2]]
Definition: vec4.cpp:289
float internal_w
w coordinate
Definition: vec4.hpp:201
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
vec4 normalized() const
normalize the vector to unit length
Definition: vec4.cpp:298
vec4 & operator+=(const vec4 &p)
internal +
Definition: vec4.cpp:200
Vectors/Points 3D.
Definition: vec3.hpp:36
std::string to_string() const
export the value as string cout<<v4(2,3,6,7) => 2 3 6 7
Definition: vec4.cpp:277
void set_zero()
set every entry to 0
Definition: vec4.cpp:124
float z() const
get z coordinate
Definition: vec4.cpp:57
vec4 operator-() const
unary negation
Definition: vec4.cpp:259
float norm2() const
get the square norm of the vector
Definition: vec4.cpp:142
Vectors/Points 4D.
Definition: vec4.hpp:36
float dot(const vec4 &p) const
perform dot product between two v4
Definition: vec4.cpp:132
vec4 operator*(float s) const
multiply by a scalar operator
Definition: vec4.cpp:185
vec4 & operator*=(float s)
internal *
Definition: vec4.cpp:237