Browse Source

Math: doc++

Fixing Engrish while doing the Python bindings.
pull/228/head
Vladimír Vondruš 7 years ago
parent
commit
4b4b8efc1b
  1. 12
      src/Magnum/Math/BoolVector.h
  2. 14
      src/Magnum/Math/Matrix.h
  3. 23
      src/Magnum/Math/Matrix3.h
  4. 49
      src/Magnum/Math/Matrix4.h
  5. 62
      src/Magnum/Math/Quaternion.h
  6. 68
      src/Magnum/Math/RectangularMatrix.h
  7. 20
      src/Magnum/Math/Unit.h
  8. 132
      src/Magnum/Math/Vector.h
  9. 8
      src/Magnum/Math/Vector2.h
  10. 12
      src/Magnum/Math/Vector3.h

12
src/Magnum/Math/BoolVector.h

@ -108,14 +108,14 @@ template<std::size_t size> class BoolVector {
*/
constexpr /*implicit*/ BoolVector() noexcept: _data{} {}
/** @brief Construct zero-filled boolean vector */
/** @brief Construct a zero-filled boolean vector */
constexpr explicit BoolVector(ZeroInitT) noexcept: _data{} {}
/** @brief Construct without initializing the contents */
explicit BoolVector(NoInitT) noexcept {}
/**
* @brief Construct boolean vector from segment values
* @brief Construct a boolean vector from segment values
* @param first Value for first 8bit segment
* @param next Values for next Bbit segments
*/
@ -125,20 +125,20 @@ template<std::size_t size> class BoolVector {
template<class ...T, class U = typename std::enable_if<sizeof...(T)+1 == DataSize, bool>::type> constexpr /*implicit*/ BoolVector(UnsignedByte first, T... next) noexcept: _data{first, UnsignedByte(next)...} {}
#endif
/** @brief Construct boolean vector with one value for all fields */
/** @brief Construct a boolean vector with one value for all fields */
#ifdef DOXYGEN_GENERATING_OUTPUT
explicit BoolVector(T value) noexcept;
#else
template<class T, class U = typename std::enable_if<std::is_same<bool, T>::value && size != 1, bool>::type> constexpr explicit BoolVector(T value) noexcept: BoolVector(typename Implementation::GenerateSequence<DataSize>::Type(), value ? FullSegmentMask : 0) {}
#endif
/** @brief Construct boolean vector from external representation */
/** @brief Construct a boolean vector from external representation */
template<class U, class V = decltype(Implementation::BoolVectorConverter<size, U>::from(std::declval<U>()))> constexpr explicit BoolVector(const U& other) noexcept: BoolVector{Implementation::BoolVectorConverter<size, U>::from(other)} {}
/** @brief Copy constructor */
constexpr /*implicit*/ BoolVector(const BoolVector<size>&) noexcept = default;
/** @brief Convert boolean vector to external representation */
/** @brief Convert a boolean vector to external representation */
template<class U, class V = decltype(Implementation::BoolVectorConverter<size, U>::to(std::declval<BoolVector<size>>()))> constexpr explicit operator U() const {
return Implementation::BoolVectorConverter<size, U>::to(*this);
}
@ -157,7 +157,7 @@ template<std::size_t size> class BoolVector {
return (_data[i/8] >> i%8) & 0x01;
}
/** @brief Set bit at given position */
/** @brief Set a bit at given position */
BoolVector<size>& set(std::size_t i, bool value) {
value ? _data[i/8] |= (1 << i%8) :
_data[i/8] &= ~(1 << i%8);

14
src/Magnum/Math/Matrix.h

@ -70,10 +70,10 @@ template<std::size_t size, class T> class Matrix: public RectangularMatrix<size,
constexpr /*implicit*/ Matrix() noexcept: RectangularMatrix<size, size, T>{typename Implementation::GenerateSequence<size>::Type(), Vector<size, T>(T(1))} {}
/**
* @brief Identity constructor
* @brief Construct an identity matrix
*
* Creates an identity matrix. @p value allows you to specify value on
* diagonal.
* The @p value allows you to specify a value on diagonal.
* @see @ref fromDiagonal()
*/
constexpr explicit Matrix(IdentityInitT, T value = T(1)) noexcept: RectangularMatrix<size, size, T>{typename Implementation::GenerateSequence<size>::Type(), Vector<size, T>(value)} {}
@ -83,14 +83,14 @@ template<std::size_t size, class T> class Matrix: public RectangularMatrix<size,
/** @copydoc RectangularMatrix::RectangularMatrix(NoInitT) */
constexpr explicit Matrix(NoInitT) noexcept: RectangularMatrix<size, size, T>{NoInit} {}
/** @brief Construct matrix from column vectors */
/** @brief Construct from column vectors */
template<class ...U> constexpr /*implicit*/ Matrix(const Vector<size, T>& first, const U&... next) noexcept: RectangularMatrix<size, size, T>(first, next...) {}
/** @brief Construct matrix with one value for all elements */
/** @brief Construct with one value for all elements */
constexpr explicit Matrix(T value) noexcept: RectangularMatrix<size, size, T>{typename Implementation::GenerateSequence<size>::Type(), value} {}
/**
* @brief Construct matrix from another of different type
* @brief Construct from a matrix of adifferent type
*
* Performs only default casting on the values, no rounding or
* anything else. Example usage:
@ -103,7 +103,7 @@ template<std::size_t size, class T> class Matrix: public RectangularMatrix<size,
template<class U, class V = decltype(Implementation::RectangularMatrixConverter<size, size, T, U>::from(std::declval<U>()))> constexpr explicit Matrix(const U& other): RectangularMatrix<size, size, T>(Implementation::RectangularMatrixConverter<size, size, T, U>::from(other)) {}
/**
* @brief Construct matrix by slicing or expanding another of a different size
* @brief Construct by slicing or expanding a matrix of different size
*
* If the other matrix is larger, takes only the first @cpp size @ce
* columns and rows from it; if the other matrix is smaller, it's

23
src/Magnum/Math/Matrix3.h

@ -203,10 +203,9 @@ template<class T> class Matrix3: public Matrix3x3<T> {
constexpr /*implicit*/ Matrix3() noexcept: Matrix3x3<T>{IdentityInit, T(1)} {}
/**
* @brief Identity constructor
* @brief Construct an identity matrix
*
* Creates an identity matrix. @p value allows you to specify value on
* diagonal.
* The @p value allows you to specify value on diagonal.
*/
constexpr explicit Matrix3(IdentityInitT, T value = T{1}) noexcept: Matrix3x3<T>{IdentityInit, value} {}
@ -216,20 +215,20 @@ template<class T> class Matrix3: public Matrix3x3<T> {
/** @copydoc Matrix::Matrix(NoInitT) */
constexpr explicit Matrix3(NoInitT) noexcept: Matrix3x3<T>{NoInit} {}
/** @brief Construct matrix from column vectors */
/** @brief Construct from column vectors */
constexpr /*implicit*/ Matrix3(const Vector3<T>& first, const Vector3<T>& second, const Vector3<T>& third) noexcept: Matrix3x3<T>(first, second, third) {}
/** @brief Construct matrix with one value for all elements */
/** @brief Construct with one value for all elements */
constexpr explicit Matrix3(T value) noexcept: Matrix3x3<T>{value} {}
/** @copydoc Matrix::Matrix(const RectangularMatrix<size, size, U>&) */
template<class U> constexpr explicit Matrix3(const RectangularMatrix<3, 3, U>& other) noexcept: Matrix3x3<T>(other) {}
/** @brief Construct matrix from external representation */
/** @brief Construct from external representation */
template<class U, class V = decltype(Implementation::RectangularMatrixConverter<3, 3, T, U>::from(std::declval<U>()))> constexpr explicit Matrix3(const U& other) noexcept: Matrix3x3<T>(Implementation::RectangularMatrixConverter<3, 3, T, U>::from(other)) {}
/**
* @brief Construct matrix by slicing or expanding another of a different size
* @brief Construct by slicing or expanding a matrix of a different size
*
* If the other matrix is larger, takes only the first @cpp size @ce
* columns and rows from it; if the other matrix is smaller, it's
@ -241,7 +240,7 @@ template<class T> class Matrix3: public Matrix3x3<T> {
constexpr /*implicit*/ Matrix3(const RectangularMatrix<3, 3, T>& other) noexcept: Matrix3x3<T>(other) {}
/**
* @brief Check whether the matrix represents rigid transformation
* @brief Check whether the matrix represents a rigid transformation
*
* Rigid transformation consists only of rotation and translation (i.e.
* no scaling or projection).
@ -279,7 +278,7 @@ template<class T> class Matrix3: public Matrix3x3<T> {
}
/**
* @brief 2D rotation and scaling part of the matrix
* @brief 2D rotation and shear part of the matrix
*
* Normalized upper-left 2x2 part of the matrix. Assuming the following
* matrix, with the upper-left 2x2 part represented by column vectors
@ -429,7 +428,7 @@ template<class T> class Matrix3: public Matrix3x3<T> {
}
/**
* @brief Non-uniform scaling part of the matrix, squared
* @brief Non-uniform scaling part of the matrix
*
* Length of vectors in upper-left 2x2 part of the matrix. Use the
* faster alternative @ref scalingSquared() where possible. Assuming
@ -603,7 +602,7 @@ template<class T> class Matrix3: public Matrix3x3<T> {
Matrix3<T> invertedRigid() const;
/**
* @brief Transform 2D vector with the matrix
* @brief Transform a 2D vector with the matrix
*
* Unlike in @ref transformPoint(), translation is not involved in the
* transformation. @f[
@ -618,7 +617,7 @@ template<class T> class Matrix3: public Matrix3x3<T> {
}
/**
* @brief Transform 2D point with the matrix
* @brief Transform a 2D point with the matrix
*
* Unlike in @ref transformVector(), translation is also involved in
* the transformation. @f[

49
src/Magnum/Math/Matrix4.h

@ -120,7 +120,7 @@ template<class T> class Matrix4: public Matrix4x4<T> {
static Matrix4<T> rotation(Rad<T> angle, const Vector3<T>& normalizedAxis);
/**
* @brief 3D rotation matrix around X axis
* @brief 3D rotation matrix around the X axis
* @param angle Rotation angle (counterclockwise)
*
* Faster than calling @cpp Matrix4::rotation(angle, Vector3::xAxis()) @ce. @f[
@ -138,7 +138,7 @@ template<class T> class Matrix4: public Matrix4x4<T> {
static Matrix4<T> rotationX(Rad<T> angle);
/**
* @brief 3D rotation matrix around Y axis
* @brief 3D rotation matrix around the Y axis
* @param angle Rotation angle (counterclockwise)
*
* Faster than calling @cpp Matrix4::rotation(angle, Vector3::yAxis()) @ce. @f[
@ -156,7 +156,7 @@ template<class T> class Matrix4: public Matrix4x4<T> {
static Matrix4<T> rotationY(Rad<T> angle);
/**
* @brief 3D rotation matrix around Z axis
* @brief 3D rotation matrix around the Z axis
* @param angle Rotation angle (counterclockwise)
*
* Faster than calling @cpp Matrix4::rotation(angle, Vector3::zAxis()) @ce. @f[
@ -188,9 +188,9 @@ template<class T> class Matrix4: public Matrix4x4<T> {
static Matrix4<T> reflection(const Vector3<T>& normal);
/**
* @brief 3D shearing matrix along XY plane
* @param amountX Amount of shearing along X axis
* @param amountY Amount of shearing along Y axis
* @brief 3D shearing matrix along the XY plane
* @param amountX Amount of shearing along the X axis
* @param amountY Amount of shearing along the Y axis
*
* Z axis remains unchanged. @f[
* \boldsymbol{A} = \begin{pmatrix}
@ -211,9 +211,9 @@ template<class T> class Matrix4: public Matrix4x4<T> {
}
/**
* @brief 3D shearing matrix along XZ plane
* @param amountX Amount of shearing along X axis
* @param amountZ Amount of shearing along Z axis
* @brief 3D shearing matrix along the XZ plane
* @param amountX Amount of shearing along the X axis
* @param amountZ Amount of shearing along the Z axis
*
* Y axis remains unchanged. @f[
* \boldsymbol{A} = \begin{pmatrix}
@ -234,9 +234,9 @@ template<class T> class Matrix4: public Matrix4x4<T> {
}
/**
* @brief 3D shearing matrix along YZ plane
* @param amountY Amount of shearing along Y axis
* @param amountZ Amount of shearing along Z axis
* @brief 3D shearing matrix along the YZ plane
* @param amountY Amount of shearing along the Y axis
* @param amountZ Amount of shearing along the Z axis
*
* X axis remains unchanged. @f[
* \boldsymbol{A} = \begin{pmatrix}
@ -365,7 +365,7 @@ template<class T> class Matrix4: public Matrix4x4<T> {
static Matrix4<T> lookAt(const Vector3<T>& eye, const Vector3<T>& target, const Vector3<T>& up);
/**
* @brief Create matrix from rotation/scaling part and translation part
* @brief Create a matrix from a rotation/scaling part and a translation part
* @param rotationScaling Rotation/scaling part (upper-left 3x3
* matrix)
* @param translation Translation part (first three elements of
@ -388,10 +388,9 @@ template<class T> class Matrix4: public Matrix4x4<T> {
constexpr /*implicit*/ Matrix4() noexcept: Matrix4x4<T>{IdentityInit, T(1)} {}
/**
* @brief Identity constructor
* @brief Construct an identity matrix
*
* Creates an identity matrix. @p value allows you to specify value on
* diagonal.
* The @p value allows you to specify value on diagonal.
*/
constexpr explicit Matrix4(IdentityInitT, T value = T{1}) noexcept: Matrix4x4<T>{IdentityInit, value} {}
@ -401,20 +400,20 @@ template<class T> class Matrix4: public Matrix4x4<T> {
/** @copydoc Matrix::Matrix(NoInitT) */
constexpr explicit Matrix4(NoInitT) noexcept: Matrix4x4<T>{NoInit} {}
/** @brief Construct matrix from column vectors */
/** @brief Construct from column vectors */
constexpr /*implicit*/ Matrix4(const Vector4<T>& first, const Vector4<T>& second, const Vector4<T>& third, const Vector4<T>& fourth) noexcept: Matrix4x4<T>(first, second, third, fourth) {}
/** @brief Construct matrix with one value for all elements */
/** @brief Construct with one value for all elements */
constexpr explicit Matrix4(T value) noexcept: Matrix4x4<T>{value} {}
/** @copydoc Matrix::Matrix(const RectangularMatrix<size, size, U>&) */
template<class U> constexpr explicit Matrix4(const RectangularMatrix<4, 4, U>& other) noexcept: Matrix4x4<T>(other) {}
/** @brief Construct matrix from external representation */
/** @brief Construct from external representation */
template<class U, class V = decltype(Implementation::RectangularMatrixConverter<4, 4, T, U>::from(std::declval<U>()))> constexpr explicit Matrix4(const U& other): Matrix4x4<T>(Implementation::RectangularMatrixConverter<4, 4, T, U>::from(other)) {}
/**
* @brief Construct matrix by slicing or expanding another of a different size
* @brief Construct by slicing or expanding a matrix of a different size
*
* If the other matrix is larger, takes only the first @cpp size @ce
* columns and rows from it; if the other matrix is smaller, it's
@ -426,7 +425,7 @@ template<class T> class Matrix4: public Matrix4x4<T> {
constexpr /*implicit*/ Matrix4(const RectangularMatrix<4, 4, T>& other) noexcept: Matrix4x4<T>(other) {}
/**
* @brief Check whether the matrix represents rigid transformation
* @brief Check whether the matrix represents a rigid transformation
*
* Rigid transformation consists only of rotation and translation (i.e.
* no scaling or projection).
@ -467,7 +466,7 @@ template<class T> class Matrix4: public Matrix4x4<T> {
}
/**
* @brief 3D rotation and scaling part of the matrix
* @brief 3D rotation and shear part of the matrix
*
* Normalized upper-left 3x3 part of the matrix. Assuming the following
* matrix, with the upper-left 3x3 part represented by column vectors
@ -634,7 +633,7 @@ template<class T> class Matrix4: public Matrix4x4<T> {
}
/**
* @brief Non-uniform scaling part of the matrix, squared
* @brief Non-uniform scaling part of the matrix
*
* Length of vectors in upper-left 3x3 part of the matrix. Use the
* faster alternative @ref scalingSquared() where possible. Assuming
@ -838,7 +837,7 @@ template<class T> class Matrix4: public Matrix4x4<T> {
Matrix4<T> invertedRigid() const;
/**
* @brief Transform 3D vector with the matrix
* @brief Transform a 3D vector with the matrix
*
* Unlike in @ref transformVector(), translation is not involved in the
* transformation. @f[
@ -853,7 +852,7 @@ template<class T> class Matrix4: public Matrix4x4<T> {
}
/**
* @brief Transform 3D point with the matrix
* @brief Transform a 3D point with the matrix
*
* Unlike in @ref transformVector(), translation is also involved in
* the transformation. @f[

62
src/Magnum/Math/Quaternion.h

@ -259,7 +259,7 @@ template<class T> class Quaternion {
static Quaternion<T> rotation(Rad<T> angle, const Vector3<T>& normalizedAxis);
/**
* @brief Create quaternion from rotation matrix
* @brief Create a quaternion from a rotation matrix
*
* Expects that the matrix is orthogonal (i.e. pure rotation).
* @see @ref toMatrix(), @ref DualComplex::fromMatrix(),
@ -275,7 +275,7 @@ template<class T> class Quaternion {
constexpr /*implicit*/ Quaternion() noexcept: _scalar{T(1)} {}
/**
* @brief Identity constructor
* @brief Construct an identity quaternion
*
* Creates unit quaternion. @f[
* q = [\boldsymbol 0, 1]
@ -283,14 +283,14 @@ template<class T> class Quaternion {
*/
constexpr explicit Quaternion(IdentityInitT) noexcept: _scalar{T(1)} {}
/** @brief Construct zero-initialized quaternion */
/** @brief Construct a zero-initialized quaternion */
constexpr explicit Quaternion(ZeroInitT) noexcept: _vector{ZeroInit}, _scalar{T{0}} {}
/** @brief Construct without initializing the contents */
explicit Quaternion(NoInitT) noexcept: _vector{NoInit} {}
/**
* @brief Construct quaternion from vector and scalar
* @brief Construct from a vector and a scalar
*
* @f[
* q = [\boldsymbol v, s]
@ -299,7 +299,7 @@ template<class T> class Quaternion {
constexpr /*implicit*/ Quaternion(const Vector3<T>& vector, T scalar) noexcept: _vector(vector), _scalar(scalar) {}
/**
* @brief Construct quaternion from vector
* @brief Construct from a vector
*
* To be used in transformations later. @f[
* q = [\boldsymbol v, 0]
@ -309,7 +309,7 @@ template<class T> class Quaternion {
constexpr explicit Quaternion(const Vector3<T>& vector) noexcept: _vector(vector), _scalar(T(0)) {}
/**
* @brief Construct dual complex number from another of different type
* @brief Construct from a quaternion of different type
*
* Performs only default casting on the values, no rounding or anything
* else.
@ -369,7 +369,7 @@ template<class T> class Quaternion {
constexpr T scalar() const { return _scalar; } /**< @overload */
/**
* @brief Rotation angle of unit quaternion
* @brief Rotation angle of a unit quaternion
*
* Expects that the quaternion is normalized. @f[
* \theta = 2 \cdot \arccos(q_S)
@ -379,7 +379,7 @@ template<class T> class Quaternion {
Rad<T> angle() const;
/**
* @brief Rotation axis of unit quaternion
* @brief Rotation axis of a unit quaternion
*
* Expects that the quaternion is normalized. Returns either unit-length
* vector for valid rotation quaternion or NaN vector for
@ -391,7 +391,7 @@ template<class T> class Quaternion {
Vector3<T> axis() const;
/**
* @brief Convert quaternion to rotation matrix
* @brief Convert to a rotation matrix
*
* @see @ref fromMatrix(), @ref DualQuaternion::toMatrix(),
* @ref Matrix4::from(const Matrix3x3<T>&, const Vector3<T>&)
@ -399,7 +399,16 @@ template<class T> class Quaternion {
Matrix3x3<T> toMatrix() const;
/**
* @brief Add and assign quaternion
* @brief Negated quaternion
*
* @f[
* -q = [-\boldsymbol q_V, -q_S]
* @f]
*/
Quaternion<T> operator-() const { return {-_vector, -_scalar}; }
/**
* @brief Add and assign a quaternion
*
* The computation is done in-place. @f[
* p + q = [\boldsymbol p_V + \boldsymbol q_V, p_S + q_S]
@ -412,7 +421,7 @@ template<class T> class Quaternion {
}
/**
* @brief Add quaternion
* @brief Add a quaternion
*
* @see @ref operator+=()
*/
@ -421,16 +430,7 @@ template<class T> class Quaternion {
}
/**
* @brief Negated quaternion
*
* @f[
* -q = [-\boldsymbol q_V, -q_S]
* @f]
*/
Quaternion<T> operator-() const { return {-_vector, -_scalar}; }
/**
* @brief Subtract and assign quaternion
* @brief Subtract and assign a quaternion
*
* The computation is done in-place. @f[
* p - q = [\boldsymbol p_V - \boldsymbol q_V, p_S - q_S]
@ -443,7 +443,7 @@ template<class T> class Quaternion {
}
/**
* @brief Subtract quaternion
* @brief Subtract a quaternion
*
* @see @ref operator-=()
*/
@ -452,7 +452,7 @@ template<class T> class Quaternion {
}
/**
* @brief Multiply with scalar and assign
* @brief Multiply with a scalar and assign
*
* The computation is done in-place. @f[
* q \cdot a = [\boldsymbol q_V \cdot a, q_S \cdot a]
@ -465,7 +465,7 @@ template<class T> class Quaternion {
}
/**
* @brief Multiply with scalar
* @brief Multiply with a scalar
*
* @see @ref operator*=(T)
*/
@ -474,7 +474,7 @@ template<class T> class Quaternion {
}
/**
* @brief Divide with scalar and assign
* @brief Divide with a scalar and assign
*
* The computation is done in-place. @f[
* \frac q a = [\frac {\boldsymbol q_V} a, \frac {q_S} a]
@ -487,7 +487,7 @@ template<class T> class Quaternion {
}
/**
* @brief Divide with scalar
* @brief Divide with a scalar
*
* @see @ref operator/=(T)
*/
@ -496,7 +496,7 @@ template<class T> class Quaternion {
}
/**
* @brief Multiply with quaternion
* @brief Multiply with a quaternion
*
* @f[
* p q = [p_S \boldsymbol q_V + q_S \boldsymbol p_V + \boldsymbol p_V \times \boldsymbol q_V,
@ -567,7 +567,7 @@ template<class T> class Quaternion {
Quaternion<T> invertedNormalized() const;
/**
* @brief Rotate vector with quaternion
* @brief Rotate a vector with a quaternion
*
* See @ref transformVectorNormalized(), which is faster for normalized
* quaternions. @f[
@ -583,7 +583,7 @@ template<class T> class Quaternion {
}
/**
* @brief Rotate vector with normalized quaternion
* @brief Rotate a vector with a normalized quaternion
*
* Faster alternative to @ref transformVector(), expects that the
* quaternion is normalized. Done using the following equation: @f[
@ -619,7 +619,7 @@ template<class T> class Quaternion {
};
/** @relates Quaternion
@brief Multiply scalar with quaternion
@brief Multiply a scalar with a quaternion
Same as @ref Quaternion::operator*(T) const.
*/
@ -628,7 +628,7 @@ template<class T> inline Quaternion<T> operator*(T scalar, const Quaternion<T>&
}
/** @relates Quaternion
@brief Divide quaternion with number and invert
@brief Divide a quaternion with a scalar and invert
@f[
\frac a q = [\frac a {\boldsymbol q_V}, \frac a {q_S}]

68
src/Magnum/Math/RectangularMatrix.h

@ -72,7 +72,7 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
};
/**
* @brief Matrix from array
* @brief Matrix from an array
* @return Reference to the data as if it was matrix, thus doesn't
* perform any copying.
*
@ -88,7 +88,7 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
}
/**
* @brief Construct matrix from vector
* @brief Construct a matrix from a vector
*
* Rolls the vector into matrix, i.e. first `rows` elements of the
* vector will make first column of resulting matrix.
@ -99,7 +99,7 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
}
/**
* @brief Construct diagonal matrix
* @brief Construct a diagonal matrix
*
* @see @ref diagonal()
*/
@ -114,18 +114,18 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
*/
constexpr /*implicit*/ RectangularMatrix() noexcept: RectangularMatrix<cols, rows, T>{typename Implementation::GenerateSequence<cols>::Type{}, ZeroInit} {}
/** @brief Construct zero-filled matrix */
/** @brief Construct a zero-filled matrix */
constexpr explicit RectangularMatrix(ZeroInitT) noexcept: RectangularMatrix<cols, rows, T>{typename Implementation::GenerateSequence<cols>::Type{}, ZeroInit} {}
/** @brief Construct matrix without initializing the contents */
/** @brief Construct without initializing the contents */
explicit RectangularMatrix(NoInitT) noexcept: RectangularMatrix<cols, rows, T>{typename Implementation::GenerateSequence<cols>::Type{}, NoInit} {}
/** @brief Construct matrix from column vectors */
/** @brief Construct from column vectors */
template<class ...U> constexpr /*implicit*/ RectangularMatrix(const Vector<rows, T>& first, const U&... next) noexcept: _data{first, next...} {
static_assert(sizeof...(next)+1 == cols, "Improper number of arguments passed to RectangularMatrix constructor");
}
/** @brief Construct matrix with one value for all components */
/** @brief Construct with one value for all components */
constexpr explicit RectangularMatrix(T value) noexcept: RectangularMatrix{typename Implementation::GenerateSequence<cols>::Type(), value} {}
/**
@ -160,7 +160,7 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
constexpr const T* data() const { return _data[0].data(); } /**< @overload */
/**
* @brief Matrix column
* @brief Column at given position
*
* Particular elements can be accessed using @ref Vector::operator[](),
* e.g.:
@ -174,7 +174,7 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
constexpr const Vector<rows, T>& operator[](std::size_t col) const { return _data[col]; } /**< @overload */
/**
* @brief Matrix row
* @brief Row at given position
*
* Consider using @ref transposed() when accessing rows frequently, as
* this is slower than accessing columns due to the way the matrix is
@ -257,7 +257,7 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
RectangularMatrix<cols, rows, T> operator-() const;
/**
* @brief Add and assign matrix
* @brief Add and assign a matrix
*
* The computation is done column-wise in-place. @f[
* \boldsymbol A_j = \boldsymbol A_j + \boldsymbol B_j
@ -271,7 +271,7 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
}
/**
* @brief Add matrix
* @brief Add a matrix
*
* @see @ref operator+=()
*/
@ -280,7 +280,7 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
}
/**
* @brief Subtract and assign matrix
* @brief Subtract and assign a matrix
*
* The computation is done column-wise in-place. @f[
* \boldsymbol A_j = \boldsymbol A_j - \boldsymbol B_j
@ -294,7 +294,7 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
}
/**
* @brief Subtract matrix
* @brief Subtract a matrix
*
* @see @ref operator-=()
*/
@ -303,54 +303,54 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
}
/**
* @brief Multiply matrix with number and assign
* @brief Multiply with a scalar and assign
*
* The computation is done column-wise in-place. @f[
* \boldsymbol A_j = a \boldsymbol A_j
* @f]
*/
RectangularMatrix<cols, rows, T>& operator*=(T number) {
RectangularMatrix<cols, rows, T>& operator*=(T scalar) {
for(std::size_t i = 0; i != cols; ++i)
_data[i] *= number;
_data[i] *= scalar;
return *this;
}
/**
* @brief Multiply matrix with number
* @brief Multiply with a scalar
*
* @see @ref operator*=(T), @ref operator*(T, const RectangularMatrix<cols, rows, T>&)
*/
RectangularMatrix<cols, rows, T> operator*(T number) const {
return RectangularMatrix<cols, rows, T>(*this) *= number;
RectangularMatrix<cols, rows, T> operator*(T scalar) const {
return RectangularMatrix<cols, rows, T>(*this) *= scalar;
}
/**
* @brief Divide matrix with number and assign
* @brief Divide with a scalar and assign
*
* The computation is done column-wise in-place. @f[
* \boldsymbol A_j = \frac{\boldsymbol A_j} a
* @f]
*/
RectangularMatrix<cols, rows, T>& operator/=(T number) {
RectangularMatrix<cols, rows, T>& operator/=(T scalar) {
for(std::size_t i = 0; i != cols; ++i)
_data[i] /= number;
_data[i] /= scalar;
return *this;
}
/**
* @brief Divide matrix with number
* @brief Divide with a scalar
*
* @see @ref operator/=(T),
* @ref operator/(T, const RectangularMatrix<cols, rows, T>&)
*/
RectangularMatrix<cols, rows, T> operator/(T number) const {
return RectangularMatrix<cols, rows, T>(*this) /= number;
RectangularMatrix<cols, rows, T> operator/(T scalar) const {
return RectangularMatrix<cols, rows, T>(*this) /= scalar;
}
/**
* @brief Multiply matrix
* @brief Multiply a matrix
*
* @f[
* (\boldsymbol {AB})_{ji} = \sum_{k=0}^{m-1} \boldsymbol A_{ki} \boldsymbol B_{jk}
@ -360,7 +360,7 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
template<std::size_t size> RectangularMatrix<size, rows, T> operator*(const RectangularMatrix<size, cols, T>& other) const;
/**
* @brief Multiply vector
* @brief Multiply a vector
*
* Internally the same as multiplying with one-column matrix, but
* returns vector. @f[
@ -527,7 +527,7 @@ template<class T> using Matrix4x3 = RectangularMatrix<4, 3, T>;
#endif
/** @relates RectangularMatrix
@brief Multiply number with matrix
@brief Multiply a scalar with a matrix
Same as @ref RectangularMatrix::operator*(T) const.
*/
@ -537,13 +537,13 @@ template<std::size_t cols, std::size_t rows, class T> inline RectangularMatrix<c
#else
typename std::common_type<T>::type
#endif
number, const RectangularMatrix<cols, rows, T>& matrix)
scalar, const RectangularMatrix<cols, rows, T>& matrix)
{
return matrix*number;
return matrix*scalar;
}
/** @relates RectangularMatrix
@brief Divide matrix with number and invert
@brief Divide a matrix with a scalar and invert
The computation is done column-wise. @f[
\boldsymbol B_j = \frac a {\boldsymbol A_j}
@ -556,18 +556,18 @@ template<std::size_t cols, std::size_t rows, class T> inline RectangularMatrix<c
#else
typename std::common_type<T>::type
#endif
number, const RectangularMatrix<cols, rows, T>& matrix)
scalar, const RectangularMatrix<cols, rows, T>& matrix)
{
RectangularMatrix<cols, rows, T> out{NoInit};
for(std::size_t i = 0; i != cols; ++i)
out[i] = number/matrix[i];
out[i] = scalar/matrix[i];
return out;
}
/** @relates RectangularMatrix
@brief Multiply vector with rectangular matrix
@brief Multiply a vector with a rectangular matrix
Internally the same as multiplying one-column matrix with one-row matrix. @f[
(\boldsymbol {aA})_{ji} = \boldsymbol a_i \boldsymbol A_j

20
src/Magnum/Math/Unit.h

@ -53,13 +53,13 @@ template<template<class> class Derived, class T> class Unit {
*/
constexpr /*implicit*/ Unit() noexcept: _value(T(0)) {}
/** @brief Construct zero value */
/** @brief Construct a zero value */
constexpr explicit Unit(ZeroInitT) noexcept: _value(T(0)) {}
/** @brief Construct without initializing the contents */
explicit Unit(NoInitT) noexcept {}
/** @brief Explicit conversion from unitless type */
/** @brief Explicit conversion from a unitless type */
constexpr explicit Unit(T value) noexcept: _value(value) {}
/** @brief Construct from another underlying type */
@ -106,46 +106,46 @@ template<template<class> class Derived, class T> class Unit {
return Unit<Derived, T>(-_value);
}
/** @brief Add and assign value */
/** @brief Add and assign a value */
Unit<Derived, T>& operator+=(Unit<Derived, T> other) {
_value += other._value;
return *this;
}
/** @brief Add value */
/** @brief Add a value */
constexpr Unit<Derived, T> operator+(Unit<Derived, T> other) const {
return Unit<Derived, T>(_value + other._value);
}
/** @brief Subtract and assign value */
/** @brief Subtract and assign a value */
Unit<Derived, T>& operator-=(Unit<Derived, T> other) {
_value -= other._value;
return *this;
}
/** @brief Subtract value */
/** @brief Subtract a value */
constexpr Unit<Derived, T> operator-(Unit<Derived, T> other) const {
return Unit<Derived, T>(_value - other._value);
}
/** @brief Multiply with number and assign */
/** @brief Multiply with a number and assign */
Unit<Derived, T>& operator*=(T number) {
_value *= number;
return *this;
}
/** @brief Multiply with number */
/** @brief Multiply with a number */
constexpr Unit<Derived, T> operator*(T number) const {
return Unit<Derived, T>(_value*number);
}
/** @brief Divide with number and assign */
/** @brief Divide with a number and assign */
Unit<Derived, T>& operator/=(T number) {
_value /= number;
return *this;
}
/** @brief Divide with number */
/** @brief Divide with a number */
constexpr Unit<Derived, T> operator/(T number) const {
return Unit<Derived, T>(_value/number);
}

132
src/Magnum/Math/Vector.h

@ -136,7 +136,7 @@ template<std::size_t size, class T> class Vector {
};
/**
* @brief Vector from array
* @brief Vector from an array
* @return Reference to the data as if it was Vector, thus doesn't
* perform any copying.
*
@ -178,17 +178,17 @@ template<std::size_t size, class T> class Vector {
*/
constexpr explicit Vector(ZeroInitT) noexcept: _data{} {}
/** @brief Construct vector without initializing the contents */
/** @brief Construct a vector without initializing the contents */
explicit Vector(NoInitT) noexcept {}
/** @brief Construct vector from components */
/** @brief Construct a vector from components */
#ifdef DOXYGEN_GENERATING_OUTPUT
template<class ...U> constexpr /*implicit*/ Vector(T first, U... next) noexcept;
#else
template<class ...U, class V = typename std::enable_if<sizeof...(U)+1 == size, T>::type> constexpr /*implicit*/ Vector(T first, U... next) noexcept: _data{first, next...} {}
#endif
/** @brief Construct vector with one value for all components */
/** @brief Construct a vector with one value for all components */
#ifdef DOXYGEN_GENERATING_OUTPUT
constexpr explicit Vector(T value) noexcept;
#else
@ -196,7 +196,7 @@ template<std::size_t size, class T> class Vector {
#endif
/**
* @brief Construct vector from another of different type
* @brief Construct a vector from another of different type
*
* Performs only default casting on the values, no rounding or
* anything else. Example usage:
@ -205,13 +205,13 @@ template<std::size_t size, class T> class Vector {
*/
template<class U> constexpr explicit Vector(const Vector<size, U>& other) noexcept: Vector(typename Implementation::GenerateSequence<size>::Type(), other) {}
/** @brief Construct vector from external representation */
/** @brief Construct a vector from external representation */
template<class U, class V = decltype(Implementation::VectorConverter<size, T, U>::from(std::declval<U>()))> constexpr explicit Vector(const U& other) noexcept: Vector(Implementation::VectorConverter<size, T, U>::from(other)) {}
/** @brief Copy constructor */
constexpr /*implicit*/ Vector(const Vector<size, T>&) noexcept = default;
/** @brief Convert vector to external representation */
/** @brief Convert a vector to external representation */
template<class U, class V = decltype(Implementation::VectorConverter<size, T, U>::to(std::declval<Vector<size, T>>()))> constexpr explicit operator U() const {
return Implementation::VectorConverter<size, T, U>::to(*this);
}
@ -247,28 +247,28 @@ template<std::size_t size, class T> class Vector {
}
/**
* @brief Component-wise less than
* @brief Component-wise less than comparison
*
* @m_keyword{lessThan(),GLSL lessThan(),}
*/
BoolVector<size> operator<(const Vector<size, T>& other) const;
/**
* @brief Component-wise less than or equal
* @brief Component-wise less than or equal comparison
*
* @m_keyword{lessThanEqual(),GLSL lessThanEqual(),}
*/
BoolVector<size> operator<=(const Vector<size, T>& other) const;
/**
* @brief Component-wise greater than or equal
* @brief Component-wise greater than or equal comparison
*
* @m_keyword{greaterThanEqual(),GLSL greaterThanEqual(),}
*/
BoolVector<size> operator>=(const Vector<size, T>& other) const;
/**
* @brief Component-wise greater than
* @brief Component-wise greater than comparison
*
* @m_keyword{greaterThan(),GLSL greaterThan(),}
*/
@ -309,7 +309,7 @@ template<std::size_t size, class T> class Vector {
Vector<size, T> operator-() const;
/**
* @brief Add and assign vector
* @brief Add and assign a vector
*
* The computation is done in-place. @f[
* \boldsymbol a_i = \boldsymbol a_i + \boldsymbol b_i
@ -323,7 +323,7 @@ template<std::size_t size, class T> class Vector {
}
/**
* @brief Add vector
* @brief Add a vector
*
* @see @ref operator+=(), @ref sum()
*/
@ -332,7 +332,7 @@ template<std::size_t size, class T> class Vector {
}
/**
* @brief Subtract and assign vector
* @brief Subtract and assign a vector
*
* The computation is done in-place. @f[
* \boldsymbol a_i = \boldsymbol a_i - \boldsymbol b_i
@ -346,7 +346,7 @@ template<std::size_t size, class T> class Vector {
}
/**
* @brief Subtract vector
* @brief Subtract a vector
*
* @see @ref operator-=()
*/
@ -355,7 +355,7 @@ template<std::size_t size, class T> class Vector {
}
/**
* @brief Multiply vector with number and assign
* @brief Multiply with a scalar and assign
*
* The computation is done in-place. @f[
* \boldsymbol a_i = b \boldsymbol a_i
@ -363,26 +363,26 @@ template<std::size_t size, class T> class Vector {
* @see @ref operator*=(const Vector<size, T>&),
* @ref operator*=(Vector<size, Integral>&, FloatingPoint)
*/
Vector<size, T>& operator*=(T number) {
Vector<size, T>& operator*=(T scalar) {
for(std::size_t i = 0; i != size; ++i)
_data[i] *= number;
_data[i] *= scalar;
return *this;
}
/**
* @brief Multiply vector with number
* @brief Multiply with a scalar
*
* @see @ref operator*(const Vector<size, T>&) const,
* @ref operator*=(T), @ref operator*(T, const Vector<size, T>&),
* @ref operator*(const Vector<size, Integral>&, FloatingPoint)
*/
Vector<size, T> operator*(T number) const {
return Vector<size, T>(*this) *= number;
Vector<size, T> operator*(T scalar) const {
return Vector<size, T>(*this) *= scalar;
}
/**
* @brief Divide vector with number and assign
* @brief Divide with a scalar and assign
*
* The computation is done in-place. @f[
* \boldsymbol a_i = \frac{\boldsymbol a_i} b
@ -390,26 +390,26 @@ template<std::size_t size, class T> class Vector {
* @see @ref operator/=(const Vector<size, T>&),
* @ref operator/=(Vector<size, Integral>&, FloatingPoint)
*/
Vector<size, T>& operator/=(T number) {
Vector<size, T>& operator/=(T scalar) {
for(std::size_t i = 0; i != size; ++i)
_data[i] /= number;
_data[i] /= scalar;
return *this;
}
/**
* @brief Divide vector with number
* @brief Divide with a scalar
*
* @see @ref operator/(const Vector<size, T>&) const,
* @ref operator/=(T), @ref operator/(T, const Vector<size, T>&),
* @ref operator/(const Vector<size, Integral>&, FloatingPoint)
*/
Vector<size, T> operator/(T number) const {
return Vector<size, T>(*this) /= number;
Vector<size, T> operator/(T scalar) const {
return Vector<size, T>(*this) /= scalar;
}
/**
* @brief Multiply vector component-wise and assign
* @brief Multiply a vector component-wise and assign
*
* The computation is done in-place. @f[
* \boldsymbol a_i = \boldsymbol a_i \boldsymbol b_i
@ -425,7 +425,7 @@ template<std::size_t size, class T> class Vector {
}
/**
* @brief Multiply vector component-wise
* @brief Multiply a vector component-wise
*
* @see @ref operator*(T) const, @ref operator*=(const Vector<size, T>&),
* @ref operator*(const Vector<size, Integral>&, const Vector<size, FloatingPoint>&),
@ -436,7 +436,7 @@ template<std::size_t size, class T> class Vector {
}
/**
* @brief Divide vector component-wise and assign
* @brief Divide a vector component-wise and assign
*
* The computation is done in-place. @f[
* \boldsymbol a_i = \frac{\boldsymbol a_i}{\boldsymbol b_i}
@ -452,7 +452,7 @@ template<std::size_t size, class T> class Vector {
}
/**
* @brief Divide vector component-wise
* @brief Divide a vector component-wise
*
* @see @ref operator/(T) const, @ref operator/=(const Vector<size, T>&),
* @ref operator/(const Vector<size, Integral>&, const Vector<size, FloatingPoint>&)
@ -537,7 +537,7 @@ template<std::size_t size, class T> class Vector {
}
/**
* @brief Vector projected onto line
* @brief Vector projected onto a line
*
* Returns a vector projected onto @p line. Enabled only for
* floating-point types. @f[
@ -555,7 +555,7 @@ template<std::size_t size, class T> class Vector {
}
/**
* @brief Vector projected onto normalized line
* @brief Vector projected onto a normalized line
*
* Slightly faster alternative to @ref projected(), expects @p line to
* be normalized. Enabled only for floating-point types. @f[
@ -649,7 +649,7 @@ template<std::size_t size, class T> class Vector {
};
/** @relates Vector
@brief Multiply number with vector
@brief Multiply a scalar with a vector
Same as @ref Vector::operator*(T) const.
*/
@ -659,13 +659,13 @@ template<std::size_t size, class T> inline Vector<size, T> operator*(
#else
typename std::common_type<T>::type
#endif
number, const Vector<size, T>& vector)
scalar, const Vector<size, T>& vector)
{
return vector*number;
return vector*scalar;
}
/** @relates Vector
@brief Divide vector with number and invert
@brief Divide a vector with a scalar and invert
@f[
\boldsymbol c_i = \frac b {\boldsymbol a_i}
@ -678,18 +678,18 @@ template<std::size_t size, class T> inline Vector<size, T> operator/(
#else
typename std::common_type<T>::type
#endif
number, const Vector<size, T>& vector)
scalar, const Vector<size, T>& vector)
{
Vector<size, T> out;
for(std::size_t i = 0; i != size; ++i)
out[i] = number/vector[i];
out[i] = scalar/vector[i];
return out;
}
/** @relates Vector
@brief Do modulo of integral vector and assign
@brief Do modulo of an integral vector and assign
The computation is done in-place.
*/
@ -707,7 +707,7 @@ operator%=(Vector<size, Integral>& a, Integral b) {
}
/** @relates Vector
@brief Modulo of integral vector
@brief Modulo of an integral vector
*/
template<std::size_t size, class Integral> inline
#ifdef DOXYGEN_GENERATING_OUTPUT
@ -753,7 +753,7 @@ operator%(const Vector<size, Integral>& a, const Vector<size, Integral>& b) {
}
/** @relates Vector
@brief Bitwise NOT of integral vector
@brief Bitwise NOT of an integral vector
*/
template<std::size_t size, class Integral> inline
#ifdef DOXYGEN_GENERATING_OUTPUT
@ -867,7 +867,7 @@ operator^(const Vector<size, Integral>& a, const Vector<size, Integral>& b) {
}
/** @relates Vector
@brief Do bitwise left shift of integral vector and assign
@brief Do bitwise left shift of an integral vector and assign
The computation is done in-place.
*/
@ -892,7 +892,7 @@ operator<<=(Vector<size, Integral>& vector,
}
/** @relates Vector
@brief Bitwise left shift of integral vector
@brief Bitwise left shift of an integral vector
*/
template<std::size_t size, class Integral> inline
#ifdef DOXYGEN_GENERATING_OUTPUT
@ -913,7 +913,7 @@ operator<<(const Vector<size, Integral>& vector,
}
/** @relates Vector
@brief Do bitwise right shift of integral vector and assign
@brief Do bitwise right shift of an integral vector and assign
The computation is done in-place.
*/
@ -937,7 +937,7 @@ operator>>=(Vector<size, Integral>& vector,
}
/** @relates Vector
@brief Bitwise left shift of integral vector
@brief Bitwise left shift of an integral vector
*/
template<std::size_t size, class Integral> inline
#ifdef DOXYGEN_GENERATING_OUTPUT
@ -957,7 +957,7 @@ operator>>(const Vector<size, Integral>& vector,
}
/** @relates Vector
@brief Multiply integral vector with floating-point number and assign
@brief Multiply an integral vector with a floating-point scalar and assign
Similar to @ref Vector::operator*=(T), except that the multiplication is done
in floating-point. The computation is done in-place.
@ -968,15 +968,15 @@ Vector<size, Integral>&
#else
typename std::enable_if<std::is_integral<Integral>::value && std::is_floating_point<FloatingPoint>::value, Vector<size, Integral>&>::type
#endif
operator*=(Vector<size, Integral>& vector, FloatingPoint number) {
operator*=(Vector<size, Integral>& vector, FloatingPoint scalar) {
for(std::size_t i = 0; i != size; ++i)
vector[i] = Integral(vector[i]*number);
vector[i] = Integral(vector[i]*scalar);
return vector;
}
/** @relates Vector
@brief Multiply integral vector with floating-point number
@brief Multiply an integral vector with a floating-point scalar
Similar to @ref Vector::operator*(T) const, except that the multiplication is
done in floating-point.
@ -987,13 +987,13 @@ Vector<size, Integral>
#else
typename std::enable_if<std::is_integral<Integral>::value && std::is_floating_point<FloatingPoint>::value, Vector<size, Integral>>::type
#endif
operator*(const Vector<size, Integral>& vector, FloatingPoint number) {
operator*(const Vector<size, Integral>& vector, FloatingPoint scalar) {
Vector<size, Integral> copy(vector);
return copy *= number;
return copy *= scalar;
}
/** @relates Vector
@brief Multiply floating-point number with integral vector
@brief Multiply a floating-point scalar with an integral vector
Same as @ref operator*(const Vector<size, Integral>&, FloatingPoint).
*/
@ -1003,12 +1003,12 @@ Vector<size, Integral>
#else
typename std::enable_if<std::is_integral<Integral>::value && std::is_floating_point<FloatingPoint>::value, Vector<size, Integral>>::type
#endif
operator*(FloatingPoint number, const Vector<size, Integral>& vector) {
return vector*number;
operator*(FloatingPoint scalar, const Vector<size, Integral>& vector) {
return vector*scalar;
}
/** @relates Vector
@brief Divide integral vector with floating-point number and assign
@brief Divide an integral vector with a floating-point scalar and assign
Similar to @ref Vector::operator/=(T), except that the division is done in
floating-point. The computation is done in-place.
@ -1019,15 +1019,15 @@ Vector<size, Integral>&
#else
typename std::enable_if<std::is_integral<Integral>::value && std::is_floating_point<FloatingPoint>::value, Vector<size, Integral>&>::type
#endif
operator/=(Vector<size, Integral>& vector, FloatingPoint number) {
operator/=(Vector<size, Integral>& vector, FloatingPoint scalar) {
for(std::size_t i = 0; i != size; ++i)
vector[i] = Integral(vector[i]/number);
vector[i] = Integral(vector[i]/scalar);
return vector;
}
/** @relates Vector
@brief Divide integral vector with floating-point number
@brief Divide an integral vector with a floating-point scalar
Similar to @ref Vector::operator/(T) const, except that the division is done in
floating-point.
@ -1038,13 +1038,13 @@ Vector<size, Integral>
#else
typename std::enable_if<std::is_integral<Integral>::value && std::is_floating_point<FloatingPoint>::value, Vector<size, Integral>>::type
#endif
operator/(const Vector<size, Integral>& vector, FloatingPoint number) {
operator/(const Vector<size, Integral>& vector, FloatingPoint scalar) {
Vector<size, Integral> copy(vector);
return copy /= number;
return copy /= scalar;
}
/** @relates Vector
@brief Multiply integral vector with floating-point vector component-wise and assign
@brief Multiply an integral vector with a floating-point vector component-wise and assign
Similar to @ref Vector::operator*=(const Vector<size, T>&), except that the
multiplication is done in floating-point. The computation is done in-place.
@ -1063,7 +1063,7 @@ operator*=(Vector<size, Integral>& a, const Vector<size, FloatingPoint>& b) {
}
/** @relates Vector
@brief Multiply integral vector with floating-point vector component-wise
@brief Multiply an integral vector with a floating-point vector component-wise
Similar to @ref Vector::operator*(const Vector<size, T>&) const, except that
the multiplication is done in floating-point. The result is always integral
@ -1082,7 +1082,7 @@ operator*(const Vector<size, Integral>& a, const Vector<size, FloatingPoint>& b)
}
/** @relates Vector
@brief Multiply floating-point vector with integral vector component-wise
@brief Multiply a floating-point vector with an integral vector component-wise
Same as @ref operator*(const Vector<size, Integral>&, const Vector<size, FloatingPoint>&).
*/
@ -1097,7 +1097,7 @@ operator*(const Vector<size, FloatingPoint>& a, const Vector<size, Integral>& b)
}
/** @relates Vector
@brief Divide integral vector with floating-point vector component-wise and assign
@brief Divide an integral vector with a floating-point vector component-wise and assign
Similar to @ref Vector::operator/=(const Vector<size, T>&), except that the
division is done in floating-point. The computation is done in-place.
@ -1116,7 +1116,7 @@ operator/=(Vector<size, Integral>& a, const Vector<size, FloatingPoint>& b) {
}
/** @relates Vector
@brief Divide integral vector with floating-point vector component-wise
@brief Divide an integral vector with a floating-point vector component-wise
Similar to @ref Vector::operator/(const Vector<size, T>&) const, except that
the division is done in floating-point. The result is always integral vector,

8
src/Magnum/Math/Vector2.h

@ -63,7 +63,7 @@ See @ref matrix-vector for brief introduction.
template<class T> class Vector2: public Vector<2, T> {
public:
/**
* @brief Vector in direction of X axis (right)
* @brief Vector in a direction of X axis (right)
*
* Usable for translation in given axis, for example:
*
@ -74,7 +74,7 @@ template<class T> class Vector2: public Vector<2, T> {
constexpr static Vector2<T> xAxis(T length = T(1)) { return {length, T(0)}; }
/**
* @brief Vector in direction of Y axis (up)
* @brief Vector in a direction of Y axis (up)
*
* See @ref xAxis() for more information.
* @see @ref yScale(), @ref Matrix3::up()
@ -82,7 +82,7 @@ template<class T> class Vector2: public Vector<2, T> {
constexpr static Vector2<T> yAxis(T length = T(1)) { return {T(0), length}; }
/**
* @brief Scaling vector in direction of X axis (width)
* @brief Scaling vector in a direction of X axis (width)
*
* Usable for scaling along given direction, for example:
*
@ -93,7 +93,7 @@ template<class T> class Vector2: public Vector<2, T> {
constexpr static Vector2<T> xScale(T scale) { return {scale, T(1)}; }
/**
* @brief Scaling vector in direction of Y axis (height)
* @brief Scaling vector in a direction of Y axis (height)
*
* See @ref xScale() for more information.
* @see @ref yAxis()

12
src/Magnum/Math/Vector3.h

@ -67,7 +67,7 @@ See @ref matrix-vector for brief introduction.
template<class T> class Vector3: public Vector<3, T> {
public:
/**
* @brief Vector in direction of X axis (right)
* @brief Vector in a direction of X axis (right)
*
* Usable for translation or rotation along given axis, for example:
*
@ -79,7 +79,7 @@ template<class T> class Vector3: public Vector<3, T> {
constexpr static Vector3<T> xAxis(T length = T(1)) { return {length, T(0), T(0)}; }
/**
* @brief Vector in direction of Y axis (up)
* @brief Vector in a direction of Y axis (up)
*
* See @ref xAxis() for more information.
* @see @ref yScale(), @ref Color3::green(), @ref Matrix4::up()
@ -87,7 +87,7 @@ template<class T> class Vector3: public Vector<3, T> {
constexpr static Vector3<T> yAxis(T length = T(1)) { return {T(0), length, T(0)}; }
/**
* @brief Vector in direction of Z axis (backward)
* @brief Vector in a direction of Z axis (backward)
*
* See @ref xAxis() for more information.
* @see @ref zScale(), @ref Color3::blue(), @ref Matrix4::backward()
@ -95,7 +95,7 @@ template<class T> class Vector3: public Vector<3, T> {
constexpr static Vector3<T> zAxis(T length = T(1)) { return {T(0), T(0), length}; }
/**
* @brief Scaling vector in direction of X axis (width)
* @brief Scaling vector in a direction of X axis (width)
*
* Usable for scaling along given direction, for example:
*
@ -106,7 +106,7 @@ template<class T> class Vector3: public Vector<3, T> {
constexpr static Vector3<T> xScale(T scale) { return {scale, T(1), T(1)}; }
/**
* @brief Scaling vector in direction of Y axis (height)
* @brief Scaling vector in a direction of Y axis (height)
*
* See @ref xScale() for more information.
* @see @ref yAxis(), @ref Color3::magenta()
@ -114,7 +114,7 @@ template<class T> class Vector3: public Vector<3, T> {
constexpr static Vector3<T> yScale(T scale) { return {T(1), scale, T(1)}; }
/**
* @brief Scaling vector in direction of Z axis (depth)
* @brief Scaling vector in a direction of Z axis (depth)
*
* See @ref xScale() for more information.
* @see @ref zAxis(), @ref Color3::yellow()

Loading…
Cancel
Save