149 void scale(
float sx,
float sy);
vec2 normalized() const
normalize the vector to unit length
Definition: vec2.cpp:245
vec2 operator-() const
unary negation
Definition: vec2.cpp:208
void assert_size(const size_t &k) const
assert that a size_t belongs to [[0,1]]
Definition: vec2.cpp:236
vec2 operator/(float s) const
divide by a scalar operator
Definition: vec2.cpp:157
vec2 product_compontentwise(const vec2 &p) const
does componentwise mutliplication
Definition: vec2.cpp:213
float y() const
get y coordinate
Definition: vec2.cpp:44
void scale(float sx, float sy)
internal scaling (similar to componentwise)
Definition: vec2.cpp:255
void set_zero()
set every entry to 0
Definition: vec2.cpp:94
float internal_y
y coordinate
Definition: vec2.hpp:175
vec2 & operator-=(const vec2 &p)
internal -
Definition: vec2.cpp:180
vec2 operator*(float s) const
multiply by a scalar operator
Definition: vec2.cpp:152
float internal_x
x coordinate
Definition: vec2.hpp:173
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 x() const
get x coordinate
Definition: vec2.cpp:34
float operator[](const size_t &k) const
Access to the k_th entry (k in [0,1])
Definition: vec2.cpp:55
float norm2() const
get the square norm of the vector
Definition: vec2.cpp:110
vec2 & product_compontentwise_internal(const vec2 &p)
does componentwise mutliplication
Definition: vec2.cpp:218
float operator()(const size_t &k) const
Access to the k_th entry (k in [0,1])
Definition: vec2.cpp:85
matrix1x4 operator*(float s, const matrix1x4 &m)
multiply by a scalar operator
Definition: matrix1x4.cpp:93
vec2 & operator+=(const vec2 &p)
internal +
Definition: vec2.cpp:166
std::ostream & operator<<(std::ostream &stream, const matrix1x4 &_m)
output the vector in ostream
Definition: matrix1x4.cpp:182
const float * pointer() const
fast pointer access
Definition: vec2.cpp:261
Vectors/Points 2D.
Definition: vec2.hpp:34
vec2 & operator*=(float s)
internal *
Definition: vec2.cpp:194
float dot(const vec2 &p) const
perform dot product between two v2
Definition: vec2.cpp:100
vec2 & operator/=(float s)
internal /
Definition: vec2.cpp:201
float norm() const
get the norm of the vector
Definition: vec2.cpp:105
std::string to_string() const
export the value as string cout<<v2(2,3,6) => 2 3 6
Definition: vec2.cpp:224
vec2()
empty constructor
Definition: vec2.cpp:32
vec2 operator+(const vec2 &p2) const
operator
Definition: vec2.cpp:115