diff --git a/src/Math/Complex.h b/src/Math/Complex.h index 91630a9fd..06ba2f59f 100644 --- a/src/Math/Complex.h +++ b/src/Math/Complex.h @@ -47,7 +47,7 @@ template class Complex { inline constexpr /*implicit*/ Complex(): _real(T(0)), _imaginary(T(0)) {} /** - * @brief Construct complex from real and imaginary part + * @brief Construct complex number from real and imaginary part * * @f[ * c = a + ib @@ -73,10 +73,10 @@ template class Complex { inline constexpr T imaginary() const { return _imaginary; } /** - * @brief Add and assign complex + * @brief Add complex number and assign * * The computation is done in-place. @f[ - * c_0 + c_1 = a_0 + a_1 + i(b_0 + b_1) + * c_0 + c_1 = (a_0 + a_1) + i(b_0 + b_1) * @f] */ inline Complex& operator+=(const Complex& other) { @@ -86,7 +86,7 @@ template class Complex { } /** - * @brief Add complex + * @brief Add complex number * * @see operator+=() */ @@ -95,7 +95,7 @@ template class Complex { } /** - * @brief Negated complex + * @brief Negated complex number * * @f[ * -c = -a -ib @@ -106,10 +106,10 @@ template class Complex { } /** - * @brief Subtract and assign complex + * @brief Subtract complex number and assign * * The computation is done in-place. @f[ - * c_0 - c_1 = a_0 - a_1 + i(b_0 - b_1) + * c_0 - c_1 = (a_0 - a_1) + i(b_0 - b_1) * @f] */ inline Complex& operator-=(const Complex& other) { @@ -119,7 +119,7 @@ template class Complex { } /** - * @brief Subtract complex + * @brief Subtract complex number * * @see operator-=() */ diff --git a/src/Math/Matrix3.h b/src/Math/Matrix3.h index d1a455d64..4e60a23bf 100644 --- a/src/Math/Matrix3.h +++ b/src/Math/Matrix3.h @@ -206,7 +206,7 @@ template class Matrix3: public Matrix<3, T> { * @brief Transform 2D vector with the matrix * * Translation is not involved in the transformation. @f[ - * \boldsymbol v' = \boldsymbol M (v_x, v_y, 0)^T + * \boldsymbol v' = \boldsymbol M \begin{pmatrix} v_x \\ v_y \\ 0 \end{pmatrix} * @f] * @see transformPoint(), Matrix4::transformVector() */ @@ -218,7 +218,7 @@ template class Matrix3: public Matrix<3, T> { * @brief Transform 2D point with the matrix * * Unlike in transformVector(), translation is also involved. @f[ - * \boldsymbol v' = \boldsymbol M (v_x, v_y, 1)^T + * \boldsymbol v' = \boldsymbol M \begin{pmatrix} v_x \\ v_y \\ 1 \end{pmatrix} * @f] * @see Matrix4::transformPoint() */ diff --git a/src/Math/Matrix4.h b/src/Math/Matrix4.h index 9b5f2a275..eb6e3fb8e 100644 --- a/src/Math/Matrix4.h +++ b/src/Math/Matrix4.h @@ -354,7 +354,7 @@ template class Matrix4: public Matrix<4, T> { * @brief Transform 3D vector with the matrix * * Translation is not involved in the transformation. @f[ - * \boldsymbol v' = \boldsymbol M (v_x, v_y, v_z, 0)^T + * \boldsymbol v' = \boldsymbol M \begin{pmatrix} v_x \\ v_y \\ v_z \\ 0 \end{pmatrix} * @f] * @see transformPoint(), Quaternion::transformVector(), * Matrix3::transformVector() @@ -367,7 +367,7 @@ template class Matrix4: public Matrix<4, T> { * @brief Transform 3D point with the matrix * * Unlike in transformVector(), translation is also involved. @f[ - * \boldsymbol v' = \boldsymbol M (v_x, v_y, v_z, 1)^T + * \boldsymbol v' = \boldsymbol M \begin{pmatrix} v_x \\ v_y \\ v_z \\ 1 \end{pmatrix} * @f] * @see DualQuaternion::transformPoint(), Matrix3::transformPoint() */ diff --git a/src/Math/Quaternion.h b/src/Math/Quaternion.h index 1f2e02178..6eeb8d37a 100644 --- a/src/Math/Quaternion.h +++ b/src/Math/Quaternion.h @@ -57,7 +57,7 @@ template class Quaternion { * @brief Angle between normalized quaternions * * Expects that both quaternions are normalized. @f[ - * \theta = acos \left( \frac{p \cdot q}{|p| \cdot |q|} \right) + * \theta = acos \left( \frac{p \cdot q}{|p| |q|} \right) = acos(p \cdot q) * @f] */ inline static Rad angle(const Quaternion& normalizedA, const Quaternion& normalizedB) { @@ -93,7 +93,7 @@ template class Quaternion { * Expects that both quaternions are normalized. @f[ * q_{SLERP} = \frac{sin((1 - t) \theta) q_A + sin(t \theta) q_B}{sin \theta} * ~~~~~~~~~~ - * \theta = acos \left( \frac{q_A \cdot q_B}{|q_A| \cdot |q_B|} \right) + * \theta = acos \left( \frac{q_A \cdot q_B}{|q_A| \cdot |q_B|} \right) = acos(q_A \cdot q_B) * @f] * @see lerp() */ @@ -338,7 +338,7 @@ template class Quaternion { * with other values, because it doesn't compute the square root. @f[ * q \cdot q = \boldsymbol q_V \cdot \boldsymbol q_V + q_S^2 * @f] - * @see dot(const Quaternion&, const Quaternion&) + * @see dot(const Quaternion&, const Quaternion&) */ inline T dot() const { return dot(*this, *this); @@ -377,7 +377,7 @@ template class Quaternion { * * See invertedNormalized() which is faster for normalized * quaternions. @f[ - * q^{-1} = \frac{q^*}{|q|^2} = \frac{[-\boldsymbol q_V, q_S]}{q \cdot q} + * q^{-1} = \frac{q^*}{|q|^2} = \frac{q^*}{q \cdot q} * @f] */ inline Quaternion inverted() const { @@ -389,7 +389,7 @@ template class Quaternion { * * Equivalent to conjugated(). Expects that the quaternion is * normalized. @f[ - * q^{-1} = q^* = [-\boldsymbol q_V, q_S] + * q^{-1} = \frac{q^*}{|q|^2} = q^* * @f] */ inline Quaternion invertedNormalized() const { diff --git a/src/Math/Vector.h b/src/Math/Vector.h index d8debb235..9d3f472fa 100644 --- a/src/Math/Vector.h +++ b/src/Math/Vector.h @@ -82,7 +82,7 @@ template class Vector { * @brief Angle between normalized vectors * * Expects that both vectors are normalized. @f[ - * \theta = acos \left( \frac{\boldsymbol a \cdot \boldsymbol b}{|\boldsymbol a| \cdot |\boldsymbol b|} \right) = acos (\boldsymbol a \cdot \boldsymbol b) + * \theta = acos \left( \frac{\boldsymbol a \cdot \boldsymbol b}{|\boldsymbol a| |\boldsymbol b|} \right) = acos (\boldsymbol a \cdot \boldsymbol b) * @f] */ inline static Rad angle(const Vector& normalizedA, const Vector& normalizedB) { @@ -141,10 +141,9 @@ template class Vector { /** * @brief Raw data - * @return One-dimensional array of `size*size` length in column-major - * order. + * @return One-dimensional array of `size*size` length. * - * @see operator[] + * @see operator[]() */ inline T* data() { return _data; } inline constexpr const T* data() const { return _data; } /**< @overload */ @@ -387,7 +386,7 @@ template class Vector { * other values, because it doesn't compute the square root. @f[ * \boldsymbol a \cdot \boldsymbol a = \sum_{i=0}^{n-1} \boldsymbol a_i^2 * @f] - * @see dot(const Vector&, const Vector&) + * @see dot(const Vector&, const Vector&) */ inline T dot() const { return dot(*this, *this); @@ -400,6 +399,7 @@ template class Vector { * values. @f[ * |\boldsymbol a| = \sqrt{\boldsymbol a \cdot \boldsymbol a} * @f] + * @todo something like std::hypot() for possibly better precision? */ inline T length() const { return std::sqrt(dot()); diff --git a/src/Math/Vector2.h b/src/Math/Vector2.h index 64f9cc368..397d9bc16 100644 --- a/src/Math/Vector2.h +++ b/src/Math/Vector2.h @@ -81,7 +81,7 @@ template class Vector2: public Vector<2, T> { * @brief Constructor * * @f[ - * \boldsymbol v = (x, y)^T + * \boldsymbol v = \begin{pmatrix} x \\ y \end{pmatrix} * @f] */ inline constexpr /*implicit*/ Vector2(T x, T y): Vector<2, T>(x, y) {} diff --git a/src/Math/Vector3.h b/src/Math/Vector3.h index f0ed34d9c..1c92d26d1 100644 --- a/src/Math/Vector3.h +++ b/src/Math/Vector3.h @@ -113,7 +113,7 @@ template class Vector3: public Vector<3, T> { * @brief Constructor * * @f[ - * \boldsymbol v = (x, y, z)^T + * \boldsymbol v = \begin{pmatrix} x \\ y \\ z \end{pmatrix} * @f] */ inline constexpr /*implicit*/ Vector3(T x, T y, T z): Vector<3, T>(x, y, z) {} @@ -122,7 +122,7 @@ template class Vector3: public Vector<3, T> { * @brief Constructor * * @f[ - * \boldsymbol v = (v_x, v_y, z)^T + * \boldsymbol v = \begin{pmatrix} v_x \\ v_y \\ z \end{pmatrix} * @f] */ inline constexpr /*implicit*/ Vector3(const Vector2& xy, T z): Vector<3, T>(xy[0], xy[1], z) {} diff --git a/src/Math/Vector4.h b/src/Math/Vector4.h index 846634544..d54000222 100644 --- a/src/Math/Vector4.h +++ b/src/Math/Vector4.h @@ -43,7 +43,7 @@ template class Vector4: public Vector<4, T> { * @brief Constructor * * @f[ - * \boldsymbol v = (x, y, z, w)^T + * \boldsymbol v = \begin{pmatrix} x \\ y \\ z \\ w \end{pmatrix} * @f] */ inline constexpr /*implicit*/ Vector4(T x, T y, T z, T w): Vector<4, T>(x, y, z, w) {} @@ -52,7 +52,7 @@ template class Vector4: public Vector<4, T> { * @brief Constructor * * @f[ - * \boldsymbol v = (v_x, v_y, v_z, w)^T + * \boldsymbol v = \begin{pmatrix} v_x \\ v_y \\ v_z \\ w \end{pmatrix} * @f] */ inline constexpr /*implicit*/ Vector4(const Vector3& xyz, T w): Vector<4, T>(xyz[0], xyz[1], xyz[2], w) {}