|
|
constexpr | ufo::Quat< T >::Quat () noexcept=default |
| | Default constructor; initializes to the identity rotation (1, 0, 0, 0).
|
| |
|
constexpr | ufo::Transform< Dim, T >::Transform () noexcept=default |
| | Default constructor; initializes to the identity transform (zero translation and identity rotation).
|
| |
| template<std::floating_point T> |
| T | ufo::angle (Quat< T > const &q) noexcept |
| | Extracts the rotation angle (in radians) from a unit quaternion.
|
| |
| template<class T , std::size_t Dim, class U > |
| constexpr Vec< Dim, T > | ufo::cast (Vec< Dim, U > const &v) noexcept |
| | Casts each element of a vector to a new type.
|
| |
| template<SquareMatrix M> |
| constexpr auto | ufo::determinant (M const &m) noexcept |
| | Computes the determinant of a square matrix.
|
| |
| template<std::floating_point T> |
| constexpr T | ufo::dot (Quat< T > const &a, Quat< T > const &b) noexcept |
| | Computes the four-component dot product a.w*b.w + a.x*b.x + a.y*b.y + a.z*b.z.
|
| |
| template<std::floating_point T> |
| constexpr Vec< 3, T > | ufo::eigenValues (Mat< 3, 3, T > const &m) noexcept |
| | Computes the eigenvalues of a real symmetric 3×3 matrix, sorted ascending.
|
| |
template<std::size_t I, std::size_t Rows, std::size_t Cols, class T >
requires (I < Rows) |
| constexpr Vec< Cols, T > & | ufo::get (Mat< Rows, Cols, T > &m) noexcept |
| | Structured-binding accessor — lvalue reference to row I.
|
| |
template<std::size_t I, std::size_t Dim, class T >
requires (I < Dim) |
| constexpr T & | ufo::get (Vec< Dim, T > &v) noexcept |
| | Returns a reference to the I-th element for structured bindings.
|
| |
| template<std::size_t Dim, std::floating_point T> |
| constexpr Transform< Dim, T > | ufo::inverse (Transform< Dim, T > const &t) |
| | Returns the inverse of a rigid-body transform.
|
| |
| template<std::floating_point T> |
| Vec< 4, bool > | ufo::isnan (Quat< T > const &q) noexcept |
| | Returns a bool vector indicating which components are NaN.
|
| |
| template<std::floating_point T> |
| Quat< T > | ufo::mix (Quat< T > const &x, Quat< T > const &y, T a) |
| | Spherical or linear interpolation between two quaternions.
|
| |
| constexpr | ufo::Quat< T >::operator Mat< 3, 3, T > () const noexcept |
| | Converts to a row-major 3×3 rotation matrix.
|
| |
| template<std::floating_point U> |
| constexpr | ufo::Transform< Dim, T >::operator Mat< Dim, Dim, U > () const |
| | Extracts the rotation component as a Dim × Dim matrix.
|
| |
| template<std::floating_point U> |
| constexpr Vec< Dim, U > | ufo::Transform< Dim, T >::operator() (Vec< Dim, U > const &v) const |
| | Applies the transform to a vector: result = R * v + t.
|
| |
| template<std::size_t Rows, std::size_t Cols, class T > |
| constexpr Vec< Rows, T > | ufo::operator* (Mat< Rows, Cols, T > const &m, Vec< Cols, T > const &v) noexcept |
| | Multiplies a matrix by a column vector (M * v).
|
| |
| template<std::size_t Rows, std::size_t Shared, std::size_t Cols, class T > |
| constexpr Mat< Rows, Cols, T > | ufo::operator* (Mat< Rows, Shared, T > const &a, Mat< Shared, Cols, T > const &b) noexcept |
| | Matrix × matrix product.
|
| |
| template<std::size_t Dim, std::floating_point T> |
| constexpr Transform< Dim, T > | ufo::operator* (Transform< Dim, T > t1, Transform< Dim, T > const &t2) |
| | Composes two transforms: (t1 * t2)(v) = t1(t2(v)).
|
| |
| constexpr Mat | ufo::Mat< Rows, Cols, T >::operator+ () const noexcept |
| | Unary identity operator.
|
| |
| constexpr Vec | ufo::Vec< Dim, T >::operator+ () const noexcept |
| | Unary identity operator.
|
| |
| template<std::size_t Rows, std::size_t Cols, class T > |
| constexpr Mat< Rows, Cols, T > | ufo::operator+ (Mat< Rows, Cols, T > lhs, Mat< Rows, Cols, T > const &rhs) noexcept |
| | Element-wise addition of two matrices.
|
| |
| template<std::size_t Rows, std::size_t Cols, class T > |
| constexpr Mat< Rows, Cols, T > | ufo::operator+ (Mat< Rows, Cols, T > lhs, T rhs) noexcept |
| | Adds scalar rhs to every element of lhs.
|
| |
| template<std::floating_point T> |
| constexpr Quat< T > | ufo::operator+ (Quat< T > const &q) noexcept |
| | Unary plus — returns a copy of q unchanged.
|
| |
| template<std::floating_point T> |
| constexpr Quat< T > | ufo::operator+ (Quat< T > lhs, Quat< T > const &rhs) noexcept |
| | Component-wise addition of two quaternions.
|
| |
| template<std::size_t Dim, class T > |
| constexpr Vec< Dim, T > | ufo::operator+ (Vec< Dim, T > lhs, T rhs) noexcept |
| | Adds scalar rhs to every component of lhs.
|
| |
| template<std::size_t Dim, class T > |
| constexpr Vec< Dim, T > | ufo::operator+ (Vec< Dim, T > lhs, Vec< Dim, T > const &rhs) noexcept |
| | Component-wise addition of two vectors.
|
| |
| constexpr Mat & | ufo::Mat< Rows, Cols, T >::operator+= (Mat const &rhs) noexcept |
| | Adds rhs element-wise to this matrix.
|
| |
| constexpr Quat & | ufo::Quat< T >::operator+= (Quat const &q) noexcept |
| | Component-wise addition.
|
| |
| constexpr Mat & | ufo::Mat< Rows, Cols, T >::operator+= (T rhs) noexcept |
| | Adds scalar rhs to every element.
|
| |
| constexpr Vec & | ufo::Vec< Dim, T >::operator+= (T rhs) noexcept |
| | Adds scalar rhs to every component.
|
| |
| constexpr Vec & | ufo::Vec< Dim, T >::operator+= (Vec const &rhs) noexcept |
| | Adds each component of rhs to the corresponding component.
|
| |
| template<std::size_t Rows, std::size_t Cols, class T > |
| std::ostream & | ufo::operator<< (std::ostream &out, Mat< Rows, Cols, T > const &m) |
| | Writes a matrix to an output stream, one row per line.
|
| |
| template<std::floating_point T> |
| std::ostream & | ufo::operator<< (std::ostream &out, Quat< T > const &q) |
| | Writes the quaternion to an output stream as "qw: W qx: X qy: Y qz: Z".
|
| |
| template<std::size_t Dim, class T > |
| std::ostream & | ufo::operator<< (std::ostream &out, Vec< Dim, T > const &v) |
| | Writes a human-readable representation of a vector to a stream.
|
| |
| constexpr Quat & | ufo::Quat< T >::operator= (Quat const &) noexcept=default |
| | Copy assignment operator.
|
| |
| constexpr Transform & | ufo::Transform< Dim, T >::operator= (Transform const &) noexcept=default |
| | Default copy assignment operator.
|
| |
| constexpr auto & | ufo::Vec< Dim, T >::operator[] (this auto &self, size_type i) noexcept |
| | Accesses the element at index i.
|
| |
| constexpr auto & | ufo::Quat< T >::operator[] (this auto &self, size_type pos) noexcept |
| | Component access by index: 0->w, 1->x, 2->y, 3->z.
|
| |
| constexpr auto & | ufo::Mat< Rows, Cols, T >::operator[] (this auto &self, size_type r, size_type c) noexcept |
| | Accesses the element at row r, column c.
|
| |
| template<std::floating_point T> |
| Mat< 4, 4, T > | ufo::orthogonal (T left, T right, T bottom, T top) |
| | Builds a right-handed 2-D orthographic projection matrix (no depth clipping).
|
| |
| template<std::floating_point T> |
| T | ufo::roll (Quat< T > const &q) noexcept |
| | Extracts the roll angle (rotation about the X-axis) in radians.
|
| |
| template<std::floating_point T> |
| Quat< T > | ufo::rotate (Quat< T > const &q, T angle, Vec< 3, T > axis) |
| | Appends an angle-axis rotation to a quaternion.
|
| |
| static constexpr size_type | ufo::Quat< T >::size () noexcept |
| | Returns the number of components (always 4: w, x, y, z).
|
| |
| void | ufo::Quat< T >::swap (Quat &other) noexcept |
| | Swaps all components with other.
|
| |
| template<std::floating_point T> |
| void | ufo::swap (Quat< T > &lhs, Quat< T > &rhs) noexcept |
| | Non-member swap — exchanges all components of lhs and rhs.
|
| |
| constexpr T | ufo::Mat< Rows, Cols, T >::trace () const noexcept |
| | Computes the trace (sum of diagonal elements) of a square matrix.
|
| |
| template<class T > |
| constexpr int | ufo::sign (T val) noexcept |
| | Returns the sign of a value.
|
| |
| template<std::floating_point T> |
| constexpr T | ufo::radians (T deg) noexcept |
| | Converts degrees to radians.
|
| |
| template<std::floating_point T> |
| constexpr T | ufo::degrees (T rad) noexcept |
| | Converts radians to degrees.
|
| |
template<class T >
requires std::is_arithmetic_v<T> |
| constexpr T | ufo::ipow (T base, int exp) noexcept |
| | Computes integer power of a base.
|
| |
| template<std::floating_point T> |
| constexpr T | ufo::probabilityToLogit (T probability) |
| | Converts probability to logit value.
|
| |
| template<std::floating_point T> |
| constexpr T | ufo::logitToProbability (T logit) |
| | Converts logit value to probability.
|
| |
All numeric-related classes and functions.
Copyright (c) 2020-2026, Daniel Duberg All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.