Skip to content
Snippets Groups Projects
Verified Commit 0bd042e5 authored by orestis.malaspin's avatar orestis.malaspin
Browse files

corrected error in vec2.c comments

parent e390780f
Branches
No related tags found
No related merge requests found
...@@ -6,57 +6,68 @@ ...@@ -6,57 +6,68 @@
/// @param x_ The first component. /// @param x_ The first component.
/// @param y_ The second component. /// @param y_ The second component.
/// @return The newly created vector. /// @return The newly created vector.
vec2 vec2_create(double x_, double y_) {} vec2 vec2_create(double x_, double y_) {
}
/// Create a zero 2d vector. /// Create a zero 2d vector.
/// @return The newly created zero vector. /// @return The newly created zero vector.
vec2 vec2_create_zero() { vec2_create(0.0, 0.0); } vec2 vec2_create_zero() {
vec2_create(0.0, 0.0);
}
/// Add two vectors. /// Add two vectors.
/// @param lhs The left operand. /// @param lhs The left operand.
/// @param rhs The right operand. /// @param rhs The right operand.
/// @return The sum in a new vector. /// @return The sum in a new vector.
vec2 vec2_add(vec2 lhs, vec2 rhs) {} vec2 vec2_add(vec2 lhs, vec2 rhs) {
}
/// Substract two vectors. /// Substract two vectors.
/// @param lhs The left operand. /// @param lhs The left operand.
/// @param rhs The right operand. /// @param rhs The right operand.
/// @return The difference in a new vector. /// @return The difference in a new vector.
vec2 vec2_sub(vec2 lhs, vec2 rhs) {} vec2 vec2_sub(vec2 lhs, vec2 rhs) {
}
/// Multiply a vector by a scalar. /// Multiply a vector by a scalar.
/// @param scalar The left operand, a scalar. /// @param scalar The left operand, a scalar.
/// @param rhs The right operand, a vector. /// @param rhs The right operand, a vector.
/// @return The product in a new vector. /// @return The product in a new vector.
vec2 vec2_mul(double scalar, vec2 rhs) {} vec2 vec2_mul(double scalar, vec2 rhs) {
}
/// Compute the dot product (scalar product) between two vectors. /// Compute the dot product (scalar product) between two vectors.
/// @param lhs The left operand. /// @param lhs The left operand.
/// @param rhs The right operand. /// @param rhs The right operand.
/// @return The dot product. /// @return The dot product.
double vec2_dot(vec2 lhs, vec2 rhs) {} double vec2_dot(vec2 lhs, vec2 rhs) {
}
/// Compute the square of the euclidean norm of a given vector. /// Compute the square of the euclidean norm of a given vector.
/// @param v The vector. /// @param v The vector.
/// @return The square of the norm. /// @return The square of the norm.
double vec2_norm_sqr(vec2 v) {} double vec2_norm_sqr(vec2 v) {
}
/// Compute the euclidean norm of a given vector. /// Compute the euclidean norm of a given vector.
/// @param v The vector. /// @param v The vector.
/// @return The norm. /// @return The norm.
double vec2_norm(vec2 v) {} double vec2_norm(vec2 v) {
}
/// Compute the normalization of a given vector. /// Compute the normalization of a given vector.
/// @param v The vector. /// @param v The vector.
/// @return The new normalized vector. /// @return The new normalized vector.
vec2 vec2_normalize(vec2 v) {} vec2 vec2_normalize(vec2 v) {
}
/// Check whether two vectors are approximately equals within a given tolerance. /// Check whether two vectors are approximately equals within a given tolerance.
/// @param lhs The left operand. /// @param lhs The left operand.
/// @param rhs The right operand. /// @param rhs The right operand.
/// @param eps The tolerance. /// @param eps The tolerance.
/// @return The dot product. /// @return true if vector are approximately equal, false otherwise.
bool vec2_is_approx_equal(vec2 lhs, vec2 rhs, double eps) {} bool vec2_is_approx_equal(vec2 lhs, vec2 rhs, double eps) {
}
/// Compute the coordinates of a 2d vector (with components between 0 and 1) /// Compute the coordinates of a 2d vector (with components between 0 and 1)
/// in a given screen matrix. /// in a given screen matrix.
...@@ -64,11 +75,11 @@ bool vec2_is_approx_equal(vec2 lhs, vec2 rhs, double eps) {} ...@@ -64,11 +75,11 @@ bool vec2_is_approx_equal(vec2 lhs, vec2 rhs, double eps) {}
/// @param width The screen width. /// @param width The screen width.
/// @param height The screen height. /// @param height The screen height.
/// @return The coordinates (rwo, column). /// @return The coordinates (rwo, column).
coordinates vec2_to_coordinates(vec2 v, uint32_t width, uint32_t height) {} coordinates vec2_to_coordinates(vec2 v, uint32_t width, uint32_t height) {
}
/// Print a vector in the standard output. /// Print a vector in the standard output.
/// @param v The vector. /// @param v The vector.
void vec2_print(vec2 v) void vec2_print(vec2 v) {
{
printf("x = %g, y = %g\n", v.x, v.y); printf("x = %g, y = %g\n", v.x, v.y);
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment