|
using | Bound3 = BoundingBox<Float, 3> |
| 3D bounding box
|
using | Bound2 = BoundingBox<Float, 2> |
| 2D bounding box
|
using | Float = float |
| The primary floating-point type used throughout the math library.
|
using | Homo3 = Homogeneous<Float, 3> |
| A 3-dimensional homogeneous coordinate using the library's default Float type.
|
using | Homo2 = Homogeneous<Float, 2> |
using | Mat2 = Matrix<Float, 2, 2> |
| A 2x2 matrix of type Float.
|
using | Mat3 = Matrix<Float, 3, 3> |
| A 3x3 matrix of type Float.
|
using | Mat4 = Matrix<Float, 4, 4> |
| A 4x4 matrix of type Float.
|
using | Mat3x4 = Matrix<Float, 3, 4> |
| A 3x4 matrix of type Float.
|
using | Mat4x3 = Matrix<Float, 4, 3> |
| A 4x3 matrix of type Float.
|
using | Pt2 = Point<Float, 2> |
| A 2-dimensional point of type Float.
|
using | Pt3 = Point<Float, 3> |
| A 3-dimensional point of type Float.
|
using | Pt4 = Point<Float, 4> |
| A 4-dimensional point of type Float.
|
using | Ray3 = Ray<Float, 3> |
| A 3-dimensional ray of type Float, commonly used in 3D graphics.
|
using | Ray2 = Ray<Float, 2> |
| A 2-dimensional ray of type Float.
|
using | RayDiff3 = RayDifferential<Float, 3> |
using | Vec2 = Vector<Float, 2> |
| A 2-dimensional vector of type Float.
|
using | Vec3 = Vector<Float, 3> |
| A 3-dimensional vector of type Float.
|
using | Vec4 = Vector<Float, 4> |
| A 4-dimensional vector of type Float.
|
using | Normal2 = Normal<Float, 2> |
| A 2-dimensional vector of type Float.
|
using | Normal3 = Normal<Float, 3> |
| A 3-dimensional vector of type Float.
|
using | Normal4 = Normal<Float, 4> |
| A 4-dimensional vector of type Float.
|
|
template<typename T> |
constexpr T | abs (T x) |
| A constexpr implementation of the absolute value function.
|
template<typename T>
requires std::is_floating_point_v<T> |
constexpr T | rad2deg (T rad) |
| Converts an angle from radians to degrees.
|
template<typename T>
requires std::is_floating_point_v<T> |
constexpr T | deg2rad (T deg) |
| Converts an angle from degrees to radians.
|
template<typename T> |
constexpr T | sqrt (T x) |
| Calculates the square root of a number with constexpr support.
|
template<typename T>
requires std::is_floating_point_v<T> |
constexpr T | sin (T x) |
| Calculates the sine of an angle with constexpr support.
|
template<typename T>
requires std::is_floating_point_v<T> |
constexpr T | cos (T x) |
| Calculates the cosine of an angle with constexpr support.
|
template<typename T>
requires std::is_floating_point_v<T> |
constexpr T | tan (T x) |
| Calculates the tangent of an angle with constexpr support.
|
template<typename T>
requires std::is_floating_point_v<T> |
constexpr bool | is_equal (T a, T b) |
| Compares two floating-point values for equality.
|
template<typename T>
requires std::is_floating_point_v<T> |
constexpr bool | is_greater (T a, T b) |
| Compares if a is greater than b.
|
template<typename T>
requires std::is_floating_point_v<T> |
constexpr bool | is_less_equal (T a, T b) |
| Compares if a is less than or equal to b.
|
template<typename T>
requires std::is_floating_point_v<T> |
constexpr bool | is_less (T a, T b) |
| Compares if a is less than b.
|
template<typename T>
requires std::is_floating_point_v<T> |
constexpr bool | is_greater_equal (T a, T b) |
| Compares if a is greater than or equal to b.
|
template<typename T, int N> |
constexpr std::vector< Vector< T, N > > | get_orthogonal_bases (const Vector< T, N > &base) |
| Returns orthogonal bases for a given vector.
|
template<typename T> |
constexpr std::vector< Vector< T, 2 > > | get_orthogonal_bases (const Vector< T, 2 > &base) |
| Returns orthogonal bases for a given vector when N == 2.
|
template<typename T> |
constexpr std::vector< Vector< T, 3 > > | get_orthogonal_bases (const Vector< T, 3 > &base) |
| Returns orthogonal bases for a given vector when N == 3.
|
The namespace for math library implementation.
template<typename T>
requires std::is_floating_point_v<T>
bool pbpt::math::is_equal |
( |
T | a, |
|
|
T | b ) |
|
constexpr |
Compares two floating-point values for equality.
This function checks if the absolute difference between a and b is less than a predefined epsilon (EPSILON). This is a conservative approach, but it's useful in constexpr contexts where exact comparisons are not always possible.
- Template Parameters
-
T | Floating-point type of the values. |
- Parameters
-
a | The first value. |
b | The second value. |
- Returns
- true if abs(a - b) < EPSILON, false otherwise.
template<typename T>
requires std::is_floating_point_v<T>
Calculates the sine of an angle with constexpr support.
At compile-time, uses a Taylor series. At runtime, calls std::sin. The compile-time version performs range reduction to maintain precision.
- Template Parameters
-
T | Floating-point type of the angle. |
- Parameters
-
- Returns
- The sine of x.