Blender V5.3
blender::math Namespace Reference

Namespaces

namespace  detail
namespace  projection
namespace  tests

Classes

struct  AngleCartesianBase
struct  AngleFraction
struct  AngleRadianBase
struct  AssertUnitEpsilon
struct  AssertUnitEpsilon< QuaternionBase< U > >
class  Axis
struct  AxisAngleBase
class  AxisSigned
struct  CartesianBasis
struct  DualQuaternionBase
struct  Euler3Base
struct  EulerBase
struct  EulerXYZBase
struct  isect_result
struct  locus_entry_t
struct  QuaternionBase
struct  TypeTraits
struct  TypeTraits< float >

Typedefs

using AngleRadian = AngleRadianBase<float>
using AngleCartesian = AngleCartesianBase<float>
using AxisAngle = AxisAngleBase<float, AngleRadianBase<float>>
using AxisAngleCartesian = AxisAngleBase<float, AngleCartesianBase<float>>
using EulerXYZ = EulerXYZBase<float>
using Euler3 = Euler3Base<float>
Intermediate Types

Some functions need to have higher precision than standard floats for some operations.

using Quaternion = QuaternionBase<float>
using DualQuaternion = DualQuaternionBase<float>

Enumerations

enum  EulerOrder {
  XYZ = 1 , XZY , YXZ , YZX ,
  ZXY , ZYX
}
enum class  FilterKernel {
  Box , Tent , Quad , Cubic ,
  Catrom , Gauss , Mitch
}
enum class  InterpWrapMode { Extend , Repeat , Border }
enum class  eCubicFilter { BSpline , Mitchell }

Functions

template<typename T>
T cos (const AngleRadianBase< T > &a)
template<typename T>
T sin (const AngleRadianBase< T > &a)
template<typename T>
T tan (const AngleRadianBase< T > &a)
template<typename T>
T cos (const AngleCartesianBase< T > &a)
template<typename T>
T sin (const AngleCartesianBase< T > &a)
template<typename T>
T tan (const AngleCartesianBase< T > &a)
template<typename T>
T cos (const AngleFraction< T > &a)
template<typename T>
T sin (const AngleFraction< T > &a)
template<typename T>
T tan (const AngleFraction< T > &a)
template<typename T>
bool is_zero (const T &a)
template<typename T>
bool is_any_zero (const T &a)
template<typename T>
T abs (const T &a)
template<typename T>
T sign (const T &a)
template<typename T>
T min (const T &a, const T &b)
template<typename T>
T max (const T &a, const T &b)
template<typename T>
void max_inplace (T &a, const T &b)
template<typename T>
void min_inplace (T &a, const T &b)
template<typename T>
T clamp (const T &a, const T &min, const T &max)
template<typename T>
T step (const T &edge, const T &value)
template<typename T>
T mod (const T &a, const T &b)
template<typename T>
T safe_mod (const T &a, const T &b)
template<typename T>
T floored_mod (const T &a, const T &b)
template<typename T>
T safe_floored_mod (const T &a, const T &b)
template<typename T>
void min_max (const T &value, T &min, T &max)
template<typename T>
T safe_divide (const T &a, const T &b)
template<typename T>
T floor (const T &a)
template<typename T>
T round (const T &a)
template<typename T>
T mod_periodic (const T &a, const T &b)
template<typename T>
T ceil (const T &a)
template<typename T>
T distance (const T &a, const T &b)
template<typename T>
T fract (const T &a)
template<typename T>
T sqrt (const T &a)
template<typename T>
T rcp (const T &a)
template<typename T>
T safe_rcp (const T &a)
template<typename T>
T cos (const T &a)
template<typename T>
T sin (const T &a)
template<typename T>
T tan (const T &a)
template<typename T>
T acos (const T &a)
template<typename T>
T pow (const T &x, const T &power)
template<typename T>
T safe_pow (const T &x, const T &power)
template<typename T>
T fallback_pow (const T &x, const T &power, const T &fallback)
template<typename T>
T square (const T &a)
template<typename T>
T cube (const T &a)
template<typename T>
T exp (const T &x)
template<typename T>
T log (const T &x)
template<typename T>
T safe_acos (const T &a)
float safe_acos_approx (float x)
template<typename T>
T asin (const T &a)
template<typename T>
T atan (const T &a)
template<typename T>
T atan2 (const T &y, const T &x)
template<typename T>
T hypot (const T &y, const T &x)
template<typename T, typename FactorT>
T interpolate (const T &a, const T &b, const FactorT &t)
template<typename T>
T midpoint (const T &a, const T &b)
template<eAlpha Alpha>
ColorSceneLinear4f< Alpha > interpolate (const ColorSceneLinear4f< Alpha > &a, const ColorSceneLinear4f< Alpha > &b, const float t)
template<eAlpha Alpha>
ColorSceneLinearByteEncoded4b< Alpha > interpolate (const ColorSceneLinearByteEncoded4b< Alpha > &a, const ColorSceneLinearByteEncoded4b< Alpha > &b, const float t)
float3 whitepoint_from_temp_tint (float temperature, float tint)
bool whitepoint_to_temp_tint (const float3 &white, float &temperature, float &tint)
float3x3 chromatic_adaption_matrix (const float3 &from_XYZ, const float3 &to_XYZ)
std::ostream & operator<< (std::ostream &stream, EulerOrder order)
float filter_kernel_value (FilterKernel kernel, float x)
uint16_t float_to_half (float v)
uint16_t float_to_half_make_finite (float v)
float half_to_float (uint16_t v)
void float_to_half_array (const float *src, uint16_t *dst, size_t length)
void float_to_half_clamp_array (const float *src, uint16_t *dst, size_t length, float min_value, float max_value)
void float_to_half_make_finite_array (const float *src, uint16_t *dst, size_t length)
void half_to_float_array (const uint16_t *src, float *dst, size_t length)
BLI_INLINE int32_t wrap_coord (float u, int32_t size, InterpWrapMode wrap)
BLI_INLINE void interpolate_nearest_wrapmode_fl (const float *buffer, float *output, int width, int height, int components, float u, float v, InterpWrapMode wrap_u, InterpWrapMode wrap_v)
void interpolate_nearest_border_byte (const uchar *buffer, uchar *output, int width, int height, float u, float v)
uchar4 interpolate_nearest_border_byte (const uchar *buffer, int width, int height, float u, float v)
void interpolate_nearest_border_fl (const float *buffer, float *output, int width, int height, int components, float u, float v)
float4 interpolate_nearest_border_fl (const float *buffer, int width, int height, float u, float v)
void interpolate_nearest_byte (const uchar *buffer, uchar *output, int width, int height, float u, float v)
uchar4 interpolate_nearest_byte (const uchar *buffer, int width, int height, float u, float v)
void interpolate_nearest_fl (const float *buffer, float *output, int width, int height, int components, float u, float v)
float4 interpolate_nearest_fl (const float *buffer, int width, int height, float u, float v)
int32_t wrap_coord (float u, int32_t size)
void interpolate_nearest_wrap_byte (const uchar *buffer, uchar *output, int width, int height, float u, float v)
uchar4 interpolate_nearest_wrap_byte (const uchar *buffer, int width, int height, float u, float v)
void interpolate_nearest_wrap_fl (const float *buffer, float *output, int width, int height, int components, float u, float v)
float4 interpolate_nearest_wrap_fl (const float *buffer, int width, int height, float u, float v)
BLI_INLINE void interpolate_bilinear_wrapmode_fl (const float *buffer, float *output, int width, int height, int components, float u, float v, InterpWrapMode wrap_x, InterpWrapMode wrap_y)
uchar4 interpolate_bilinear_border_byte (const uchar *buffer, int width, int height, float u, float v)
float4 interpolate_bilinear_border_fl (const float *buffer, int width, int height, float u, float v)
void interpolate_bilinear_border_fl (const float *buffer, float *output, int width, int height, int components, float u, float v)
uchar4 interpolate_bilinear_byte (const uchar *buffer, int width, int height, float u, float v)
float4 interpolate_bilinear_fl (const float *buffer, int width, int height, float u, float v)
void interpolate_bilinear_fl (const float *buffer, float *output, int width, int height, int components, float u, float v)
uchar4 interpolate_bilinear_wrap_byte (const uchar *buffer, int width, int height, float u, float v)
float4 interpolate_bilinear_wrap_fl (const float *buffer, int width, int height, float u, float v)
uchar4 interpolate_cubic_bspline_byte (const uchar *buffer, int width, int height, float u, float v)
float4 interpolate_cubic_bspline_fl (const float *buffer, int width, int height, float u, float v)
void interpolate_cubic_bspline_fl (const float *buffer, float *output, int width, int height, int components, float u, float v)
void interpolate_cubic_bspline_wrapmode_fl (const float *buffer, float *output, int width, int height, int components, float u, float v, InterpWrapMode wrap_u, InterpWrapMode wrap_v)
uchar4 interpolate_cubic_mitchell_byte (const uchar *buffer, int width, int height, float u, float v)
float4 interpolate_cubic_mitchell_fl (const float *buffer, int width, int height, float u, float v)
void interpolate_cubic_mitchell_fl (const float *buffer, float *output, int width, int height, int components, float u, float v)
void transform_normals (const float3x3 &transform, MutableSpan< float3 > normals)
void transform_normals (Span< float3 > src, const float3x3 &transform, MutableSpan< float3 > dst)
void transform_points (const float4x4 &transform, MutableSpan< float3 > points, bool use_threading=true)
void transform_points (Span< float3 > src, const float4x4 &transform, MutableSpan< float3 > dst, bool use_threading=true)
float3 rotate_direction_around_axis (const float3 &direction, const float3 &axis, float angle)
float3 rotate_around_axis (const float3 &vector, const float3 &center, const float3 &axis, float angle)
template<typename T, int Size>
bool almost_equal_relative (const VecBase< T, Size > &a, const VecBase< T, Size > &b, const T &epsilon_factor)
template<typename T, int Size>
VecBase< T, Size > abs (const VecBase< T, Size > &a)
template<typename T, int Size>
VecBase< T, Size > sign (const VecBase< T, Size > &a)
template<typename T, int Size>
VecBase< T, Size > min (const VecBase< T, Size > &a, const VecBase< T, Size > &b)
template<typename T, int Size>
VecBase< T, Size > min (Span< VecBase< T, Size > > values)
template<typename T, int Size>
VecBase< T, Size > min (std::initializer_list< VecBase< T, Size > > values)
template<typename T, int Size>
VecBase< T, Size > max (const VecBase< T, Size > &a, const VecBase< T, Size > &b)
template<typename T, int Size>
VecBase< T, Size > max (Span< VecBase< T, Size > > values)
template<typename T, int Size>
VecBase< T, Size > max (std::initializer_list< VecBase< T, Size > > values)
template<typename T, int Size>
VecBase< T, Size > clamp (const VecBase< T, Size > &a, const VecBase< T, Size > &min, const VecBase< T, Size > &max)
template<typename T, int Size>
VecBase< T, Size > clamp (const VecBase< T, Size > &a, const T &min, const T &max)
template<typename T, int Size>
VecBase< T, Size > step (const VecBase< T, Size > &edge, const VecBase< T, Size > &value)
template<typename T, int Size>
VecBase< T, Size > step (const T &edge, const VecBase< T, Size > &value)
template<typename T, int Size>
VecBase< T, Size > mod (const VecBase< T, Size > &a, const VecBase< T, Size > &b)
template<typename T, int Size>
VecBase< T, Size > mod (const VecBase< T, Size > &a, const T &b)
template<typename T, int Size>
VecBase< T, Size > safe_mod (const VecBase< T, Size > &a, const VecBase< T, Size > &b)
template<typename T, int Size>
VecBase< T, Size > safe_mod (const VecBase< T, Size > &a, const T &b)
template<typename T, int Size>
VecBase< T, Size > floored_mod (const VecBase< T, Size > &a, const VecBase< T, Size > &b)
template<typename T, int Size>
VecBase< T, Size > floored_mod (const VecBase< T, Size > &a, const T &b)
template<typename T, int Size>
VecBase< T, Size > pow (const VecBase< T, Size > &x, const T &y)
template<typename T, int Size>
VecBase< T, Size > safe_pow (const VecBase< T, Size > &x, const T &y)
template<typename T, int Size>
VecBase< T, Size > fallback_pow (const VecBase< T, Size > &x, const T &y, const VecBase< T, Size > &fallback)
template<typename T, int Size>
VecBase< T, Size > pow (const VecBase< T, Size > &x, const VecBase< T, Size > &y)
template<typename T, int Size>
VecBase< T, Size > square (const VecBase< T, Size > &a)
template<typename T, int Size>
VecBase< T, Size > exp (const VecBase< T, Size > &x)
template<typename T, int Size>
VecBase< T, Size > log (const VecBase< T, Size > &x)
template<typename T, int Size>
VecBase< T, Size > ceil_to_multiple (const VecBase< T, Size > &a, const VecBase< T, Size > &b)
template<typename T, int Size>
VecBase< T, Size > divide_ceil (const VecBase< T, Size > &a, const VecBase< T, Size > &b)
template<typename T, int Size>
void min_max (const VecBase< T, Size > &vector, VecBase< T, Size > &min, VecBase< T, Size > &max)
template<typename T, int Size>
VecBase< T, Size > safe_divide (const VecBase< T, Size > &a, const VecBase< T, Size > &b)
template<typename T, int Size>
VecBase< T, Size > safe_divide (const VecBase< T, Size > &a, const T &b)
template<typename T, int Size>
VecBase< T, Size > floor (const VecBase< T, Size > &a)
template<typename T, int Size>
VecBase< T, Size > round (const VecBase< T, Size > &a)
template<typename T, int Size>
VecBase< T, Size > ceil (const VecBase< T, Size > &a)
template<typename T, int Size>
VecBase< T, Size > sqrt (const VecBase< T, Size > &a)
template<typename T, int Size>
VecBase< T, Size > safe_sqrt (const VecBase< T, Size > &a)
template<typename T, int Size>
VecBase< T, Size > rcp (const VecBase< T, Size > &a)
template<typename T, int Size>
VecBase< T, Size > safe_rcp (const VecBase< T, Size > &a)
template<typename T, int Size>
VecBase< T, Size > fract (const VecBase< T, Size > &a)
template<typename T, int Size>
T dot (const VecBase< T, Size > &a, const VecBase< T, Size > &b)
template<typename T, int Size>
T length_manhattan (const VecBase< T, Size > &a)
template<typename T, int Size>
T length_squared (const VecBase< T, Size > &a)
template<typename T, int Size>
T length (const VecBase< T, Size > &a)
template<typename T, int Size>
bool is_unit_scale (const VecBase< T, Size > &v)
template<typename T, int Size>
T distance_manhattan (const VecBase< T, Size > &a, const VecBase< T, Size > &b)
template<typename T, int Size>
T distance_squared (const VecBase< T, Size > &a, const VecBase< T, Size > &b)
template<typename T, int Size>
T distance (const VecBase< T, Size > &a, const VecBase< T, Size > &b)
template<typename T, int Size>
VecBase< T, Size > reflect (const VecBase< T, Size > &incident, const VecBase< T, Size > &normal)
template<typename T, int Size>
VecBase< T, Size > refract (const VecBase< T, Size > &incident, const VecBase< T, Size > &normal, const T &eta)
template<typename T, int Size>
VecBase< T, Size > project (const VecBase< T, Size > &p, const VecBase< T, Size > &v_proj)
template<typename T, int Size>
VecBase< T, Size > normalize_and_get_length (const VecBase< T, Size > &v, T &out_length)
template<typename T, int Size>
VecBase< T, Size > normalize (const VecBase< T, Size > &v)
template<typename T>
T cross (const VecBase< T, 2 > &a, const VecBase< T, 2 > &b)
template<typename T>
VecBase< T, 3 > cross (const VecBase< T, 3 > &a, const VecBase< T, 3 > &b)
VecBase< float, 3 > cross_high_precision (const VecBase< float, 3 > &a, const VecBase< float, 3 > &b)
template<typename T>
VecBase< T, 3 > cross_poly (Span< VecBase< T, 3 > > poly)
template<typename T>
VecBase< T, 3 > cross_tri (const VecBase< T, 3 > &v1, const VecBase< T, 3 > &v2, const VecBase< T, 3 > &v3)
template<typename T>
VecBase< T, 3 > normal_tri (const VecBase< T, 3 > &v1, const VecBase< T, 3 > &v2, const VecBase< T, 3 > &v3)
template<typename T, typename FactorT, int Size>
VecBase< T, Size > interpolate (const VecBase< T, Size > &a, const VecBase< T, Size > &b, const FactorT &t)
template<typename T, int Size>
VecBase< T, Size > midpoint (const VecBase< T, Size > &a, const VecBase< T, Size > &b)
template<typename T, int Size>
VecBase< T, Size > faceforward (const VecBase< T, Size > &vector, const VecBase< T, Size > &incident, const VecBase< T, Size > &reference)
template<typename T>
int dominant_axis (const VecBase< T, 3 > &a)
template<typename T, int Size>
T reduce_max (const VecBase< T, Size > &a)
template<typename T, int Size>
T reduce_min (const VecBase< T, Size > &a)
template<typename T, int Size>
T reduce_add (const VecBase< T, Size > &a)
template<typename T, int Size>
T reduce_mul (const VecBase< T, Size > &a)
template<typename T, int Size>
T average (const VecBase< T, Size > &a)
template<typename T>
VecBase< T, 3 > orthogonal (const VecBase< T, 3 > &v)
template<typename T>
VecBase< T, 2 > orthogonal (const VecBase< T, 2 > &v)
template<typename T, int Size>
bool is_equal (const VecBase< T, Size > &a, const VecBase< T, Size > &b, const T epsilon=T(0))
template<typename T, int Size>
bool is_zero (const VecBase< T, Size > &a, const T epsilon=T(0))
template<typename T, int Size>
bool is_any_zero (const VecBase< T, Size > &a)
template<typename T, int Size>
bool is_unit (const VecBase< T, Size > &a, const T epsilon=T(10) *std::numeric_limits< T >::epsilon())
template<typename T, int Size>
isect_result< VecBase< T, Size > > isect_seg_seg (const VecBase< T, Size > &v1, const VecBase< T, Size > &v2, const VecBase< T, Size > &v3, const VecBase< T, Size > &v4)
template<typename T>
constexpr uint64_t vector_hash (const T &vec)
std::ostream & operator<< (std::ostream &stream, const Axis axis)
std::ostream & operator<< (std::ostream &stream, const AxisSigned axis)
std::ostream & operator<< (std::ostream &stream, const CartesianBasis &rot)
static float filt_quadratic (float x)
static float filt_cubic (float x)
static float filt_catrom (float x)
static float filt_mitchell (float x)
template<enum eCubicFilter filter>
static float4 cubic_filter_coefficients (float f)
template<typename T, eCubicFilter filter>
BLI_INLINE void bicubic_interpolation (const T *src_buffer, T *output, int width, int height, int components, float u, float v, InterpWrapMode wrap_u, InterpWrapMode wrap_v)
template<bool border>
BLI_INLINE uchar4 bilinear_byte_impl (const uchar *buffer, int width, int height, float u, float v)
template<typename T>
bool is_similarity_transform (const MatBase< T, 3, 3 > &matrix, const T &epsilon=1e-6)
static bool skip_transform (const float4x4 &transform)
static void transform_points_no_threading (const Span< float3 > src, const float4x4 &transform, MutableSpan< float3 > dst)
static void transform_points_no_threading (const float4x4 &transform, MutableSpan< float3 > points)
template<>
isect_result< float2 > isect_seg_seg (const float2 &v1, const float2 &v2, const float2 &v3, const float2 &v4)
template<>
isect_result< double2 > isect_seg_seg (const double2 &v1, const double2 &v2, const double2 &v3, const double2 &v4)
Conversion to Quaternions
template<typename T, typename AngleT>
QuaternionBase< T > to_quaternion (const AxisAngleBase< T, AngleT > &axis_angle)
template<typename T>
QuaternionBase< T > to_quaternion (const EulerXYZBase< T > &eul)
template<typename T>
QuaternionBase< T > to_quaternion (const Euler3Base< T > &eulO)
Conversion to Euler
template<typename T, typename AngleT>
Euler3Base< T > to_euler (const AxisAngleBase< T, AngleT > &axis_angle, EulerOrder order)
template<typename T, typename AngleT>
EulerXYZBase< T > to_euler (const AxisAngleBase< T, AngleT > &axis_angle)
template<typename T, typename AngleT = AngleRadian>
AxisAngleBase< T, AngleT > to_axis_angle (const QuaternionBase< T > &quat)
template<typename T>
EulerXYZBase< T > to_euler (const QuaternionBase< T > &quat)
template<typename T>
Euler3Base< T > to_euler (const QuaternionBase< T > &quat, EulerOrder order)
Axes
constexpr bool operator<= (const Axis::Value a, const Axis::Value b)
constexpr bool operator<= (const AxisSigned::Value a, const AxisSigned::Value b)
Axes Utilities
template<>
AxisSigned abs (const AxisSigned &axis)
int sign (const AxisSigned &axis)
AxisSigned cross (const AxisSigned a, const AxisSigned b)
template<typename T>
T to_vector (const Axis axis)
template<typename T>
T to_vector (const AxisSigned axis)
CartesianBasis
CartesianBasis from_orthonormal_axes (const AxisSigned forward, const AxisSigned up)
CartesianBasis rotation_between (const CartesianBasis &a, const CartesianBasis &b)
CartesianBasis rotation_between (const AxisSigned a_forward, const AxisSigned b_forward)
template<typename T>
VecBase< T, 3 > transform_point (const CartesianBasis &basis, const VecBase< T, 3 > &v)
CartesianBasis invert (const CartesianBasis &basis)
Conversion to axis angles
template<typename T, typename AngleT = AngleRadian>
AxisAngleBase< T, AngleT > to_axis_angle (const EulerXYZBase< T > &euler)
template<typename T, typename AngleT = AngleRadian>
AxisAngleBase< T, AngleT > to_axis_angle (const Euler3Base< T > &euler)
Normals & Area
template<typename T>
VecBase< T, 3 > normal_quad (const VecBase< T, 3 > &v1, const VecBase< T, 3 > &v2, const VecBase< T, 3 > &v3, const VecBase< T, 3 > &v4)
template<typename T>
T area_tri (const VecBase< T, 3 > &v1, const VecBase< T, 3 > &v2, const VecBase< T, 3 > &v3)
template<typename T>
T cotangent_tri_weight (const VecBase< T, 3 > &v1, const VecBase< T, 3 > &v2, const VecBase< T, 3 > &v3)
Planes
template<typename T>
VecBase< T, 4 > plane_from_point_normal (const VecBase< T, 3 > &co, const VecBase< T, 3 > &no)
template<typename T>
T plane_point_side (const VecBase< T, 4 > &plane, const VecBase< T, 3 > &co)
 TEST (math_geom_hh, PlaneFromPointNormal)
 TEST (math_geom_hh, PlanePointSide)
Distance & Closest Points
template<typename T, int Size>
VecBase< T, Size > closest_to_line_segment (const VecBase< T, Size > &p, const VecBase< T, Size > &l1, const VecBase< T, Size > &l2)
template<typename T, int Size>
T dist_squared_to_line_segment (const VecBase< T, Size > &p, const VecBase< T, Size > &l1, const VecBase< T, Size > &l2)
template<typename T>
VecBase< T, 3 > closest_to_plane_normalized (const VecBase< T, 4 > &plane, const VecBase< T, 3 > &pt)
template<typename T>
VecBase< T, 3 > closest_to_plane (const VecBase< T, 4 > &plane, const VecBase< T, 3 > &pt)
template<typename T>
T dist_squared_to_plane (const VecBase< T, 3 > &p, const VecBase< T, 4 > &plane)
 TEST (math_geom_hh, DistSquaredToLineSegment2D)
 TEST (math_geom_hh, DistSquaredToLineSegment3D)
 TEST (math_geom_hh, ClosestToLineSegment3D)
 TEST (math_geom_hh, ClosestToPlaneNormalized)
 TEST (math_geom_hh, ClosestToPlane)
 TEST (math_geom_hh, DistSquaredToPlane)
Projection Factors
template<typename T, int Size>
T line_point_factor (const VecBase< T, Size > &p, const VecBase< T, Size > &l1, const VecBase< T, Size > &l2)
 TEST (math_geom_hh, LinePointFactor3D)
 TEST (math_geom_hh, LinePointFactor2D)
Matrix Utilities
float3x3 axis_dominant_to_m3 (const float3 &normal)
 TEST (math_geom_hh, AxisDominantToM3)
Intersection
int isect_line_line (const float3 &v1, const float3 &v2, const float3 &v3, const float3 &v4, float3 &r_i1, float3 &r_i2)
std::optional< float3 > isect_line_plane (const float3 &l1, const float3 &l2, const float3 &plane_co, const float3 &plane_no)
template<typename T>
int isect_point_tri (const VecBase< T, 2 > &pt, const VecBase< T, 2 > &v1, const VecBase< T, 2 > &v2, const VecBase< T, 2 > &v3)
template<typename T>
int isect_point_quad (const VecBase< T, 2 > &p, const VecBase< T, 2 > &v1, const VecBase< T, 2 > &v2, const VecBase< T, 2 > &v3, const VecBase< T, 2 > &v4)
bool isect_point_poly (const float2 &pt, Span< float2 > verts)
 TEST (math_geom_hh, IsectLineLine3D)
 TEST (math_geom_hh, IsectLinePlane)
 TEST (math_geom_hh, IsectPointTri2D)
 TEST (math_geom_hh, IsectPointQuad2D)
 TEST (math_geom_hh, IsectPointPoly)
Barycentric Coordinates
float3 barycentric_weights (const float2 &v1, const float2 &v2, const float2 &v3, const float2 &co)
 TEST (math_geom_hh, BarycentricWeights)
Polygon Utilities
constexpr int poly_to_tri_count (const int poly_count, const int corner_count)
float area_poly (Span< float2 > verts)
void interp_weights_poly (MutableSpan< float > r_weights, Span< float2 > verts, const float2 &co)
 TEST (math_geom_hh, PolyToTriCount)
 TEST (math_geom_hh, AreaPoly)
 TEST (math_geom_hh, InterpWeightsPoly)
Interpolation
template<typename T>
VecBase< T, 3 > interp_bilinear_quad (const VecBase< T, 3 > &v0, const VecBase< T, 3 > &v1, const VecBase< T, 3 > &v2, const VecBase< T, 3 > &v3, const T u, const T v)
 TEST (math_geom_hh, InterpBilinearQuad)
Mapping
float2 map_to_sphere (const float3 &co)
 TEST (math_geom_hh, MapToSphere)
Matrix Operations
template<typename T, int Size>
MatBase< T, Size, Size > invert (const MatBase< T, Size, Size > &mat, bool &r_success)
template<typename T, int NumCol, int NumRow>
MatBase< T, NumCol, NumRow > transpose (const MatBase< T, NumRow, NumCol > &mat)
template<typename T, int NumCol, int NumRow>
MatBase< T, NumCol, NumRow > normalize (const MatBase< T, NumCol, NumRow > &a)
template<typename T, int NumCol, int NumRow, typename VectorT>
MatBase< T, NumCol, NumRow > normalize_and_get_size (const MatBase< T, NumCol, NumRow > &a, VectorT &r_size)
template<typename T, int Size>
T determinant (const MatBase< T, Size, Size > &mat)
template<typename T, int Size>
MatBase< T, Size, Size > adjoint (const MatBase< T, Size, Size > &mat)
template<typename T, int NumCol, int NumRow, typename VectorT>
MatBase< T, NumCol, NumRow > translate (const MatBase< T, NumCol, NumRow > &mat, const VectorT &translation)
template<typename T, int NumCol, int NumRow, typename RotationT>
MatBase< T, NumCol, NumRow > rotate (const MatBase< T, NumCol, NumRow > &mat, const RotationT &rotation)
template<typename T, int NumCol, int NumRow, typename VectorT>
MatBase< T, NumCol, NumRow > scale (const MatBase< T, NumCol, NumRow > &mat, const VectorT &scale)
template<typename T, int NumCol, int NumRow>
MatBase< T, NumCol, NumRow > interpolate_linear (const MatBase< T, NumCol, NumRow > &a, const MatBase< T, NumCol, NumRow > &b, T t)
template<typename T>
MatBase< T, 3, 3 > interpolate (const MatBase< T, 3, 3 > &a, const MatBase< T, 3, 3 > &b, T t)
template<typename T>
MatBase< T, 4, 4 > interpolate (const MatBase< T, 4, 4 > &a, const MatBase< T, 4, 4 > &b, T t)
template<typename T>
MatBase< T, 3, 3 > interpolate_fast (const MatBase< T, 3, 3 > &a, const MatBase< T, 3, 3 > &b, T t)
template<typename T>
MatBase< T, 4, 4 > interpolate_fast (const MatBase< T, 4, 4 > &a, const MatBase< T, 4, 4 > &b, T t)
template<typename T, int Size>
MatBase< T, Size, Size > pseudo_invert (const MatBase< T, Size, Size > &mat, T epsilon=1e-8)
Init helpers.
template<typename MatT>
MatT from_location (const typename MatT::loc_type &location)
template<typename MatT, int ScaleDim>
MatT from_scale (const VecBase< typename MatT::base_type, ScaleDim > &scale)
template<typename MatT, typename RotationT>
MatT from_rotation (const RotationT &rotation)
template<typename MatT, typename RotationT, typename VectorT>
MatT from_rot_scale (const RotationT &rotation, const VectorT &scale)
template<typename MatT, typename RotationT>
MatT from_loc_rot (const typename MatT::loc_type &location, const RotationT &rotation)
template<typename MatT, int ScaleDim>
MatT from_loc_scale (const typename MatT::loc_type &location, const VecBase< typename MatT::base_type, ScaleDim > &scale)
template<typename MatT, typename RotationT, int ScaleDim>
MatT from_loc_rot_scale (const typename MatT::loc_type &location, const RotationT &rotation, const VecBase< typename MatT::base_type, ScaleDim > &scale)
template<typename T>
MatBase< T, 2, 2 > from_direction (const VecBase< T, 2 > &direction)
template<typename MatT, typename VectorT>
MatT from_orthonormal_axes (const VectorT forward, const VectorT up)
template<typename MatT, typename VectorT>
MatT from_orthonormal_axes (const VectorT location, const VectorT forward, const VectorT up)
template<typename MatT, typename VectorT>
MatT from_up_axis (const VectorT up)
template<typename MatT>
MatT orthogonalize (const MatT &mat, const Axis axis)
template<typename MatT, typename VectorT>
MatT from_origin_transform (const MatT &transform, const VectorT origin)
Conversion function.
template<typename T>
AngleRadianBase< T > to_angle (const MatBase< T, 2, 2 > &mat)
template<typename T>
EulerXYZBase< T > to_euler (const MatBase< T, 3, 3 > &mat)
template<typename T>
EulerXYZBase< T > to_euler (const MatBase< T, 4, 4 > &mat)
template<typename T>
Euler3Base< T > to_euler (const MatBase< T, 3, 3 > &mat, EulerOrder order)
template<typename T>
Euler3Base< T > to_euler (const MatBase< T, 4, 4 > &mat, EulerOrder order)
template<typename T>
EulerXYZBase< T > to_nearest_euler (const MatBase< T, 3, 3 > &mat, const EulerXYZBase< T > &reference)
template<typename T>
EulerXYZBase< T > to_nearest_euler (const MatBase< T, 4, 4 > &mat, const EulerXYZBase< T > &reference)
template<typename T>
Euler3Base< T > to_nearest_euler (const MatBase< T, 3, 3 > &mat, const Euler3Base< T > &reference)
template<typename T>
Euler3Base< T > to_nearest_euler (const MatBase< T, 4, 4 > &mat, const Euler3Base< T > &reference)
template<typename T>
QuaternionBase< T > to_quaternion (const MatBase< T, 3, 3 > &mat)
template<typename T>
QuaternionBase< T > to_quaternion (const MatBase< T, 4, 4 > &mat)
Quaternion to_quaternion_legacy (const float3x3 &mat)
template<bool AllowNegativeScale = false, typename T, int NumCol, int NumRow>
VecBase< T, 3 > to_scale (const MatBase< T, NumCol, NumRow > &mat)
template<bool AllowNegativeScale = false, typename T>
VecBase< T, 2 > to_scale (const MatBase< T, 2, 2 > &mat)
template<bool AllowNegativeScale = false, typename T>
void to_rot_scale (const MatBase< T, 2, 2 > &mat, AngleRadianBase< T > &r_rotation, VecBase< T, 2 > &r_scale)
template<bool AllowNegativeScale = false, typename T>
void to_loc_rot_scale (const MatBase< T, 3, 3 > &mat, VecBase< T, 2 > &r_location, AngleRadianBase< T > &r_rotation, VecBase< T, 2 > &r_scale)
template<bool AllowNegativeScale = false, typename T, typename RotationT>
void to_rot_scale (const MatBase< T, 3, 3 > &mat, RotationT &r_rotation, VecBase< T, 3 > &r_scale)
template<bool AllowNegativeScale = false, typename T, typename RotationT>
void to_loc_rot_scale (const MatBase< T, 4, 4 > &mat, VecBase< T, 3 > &r_location, RotationT &r_rotation, VecBase< T, 3 > &r_scale)
Transform functions.
template<typename T>
VecBase< T, 2 > transform_point (const MatBase< T, 2, 2 > &mat, const VecBase< T, 2 > &point)
template<typename T>
VecBase< T, 2 > transform_point (const MatBase< T, 3, 3 > &mat, const VecBase< T, 2 > &point)
template<typename T>
VecBase< T, 3 > transform_point (const MatBase< T, 3, 3 > &mat, const VecBase< T, 3 > &point)
template<typename T>
VecBase< T, 3 > transform_point (const MatBase< T, 4, 4 > &mat, const VecBase< T, 3 > &point)
template<typename T>
VecBase< T, 3 > transform_direction (const MatBase< T, 3, 3 > &mat, const VecBase< T, 3 > &direction)
template<typename T>
VecBase< T, 3 > transform_direction (const MatBase< T, 4, 4 > &mat, const VecBase< T, 3 > &direction)
template<typename MatT, typename VectorT>
VectorT project_point (const MatT &mat, const VectorT &point)
template<typename MatT, typename VectorT>
VectorT project_point_safe (const MatT &mat, const VectorT &point)
template<typename T>
VecBase< T, 3 > transform_point (const QuaternionBase< T > &q, const VecBase< T, 3 > &v)
Compare / Test
template<typename T>
bool is_negative (const MatBase< T, 3, 3 > &mat)
template<typename T>
bool is_negative (const MatBase< T, 4, 4 > &mat)
template<typename T, int NumCol, int NumRow>
bool is_equal (const MatBase< T, NumCol, NumRow > &a, const MatBase< T, NumCol, NumRow > &b, const T epsilon=T(0))
template<typename T, int NumCol, int NumRow>
bool is_identity (const MatBase< T, NumCol, NumRow > &mat)
template<typename MatT>
bool is_orthogonal (const MatT &mat)
template<typename MatT>
bool is_orthonormal (const MatT &mat)
template<typename MatT>
bool is_uniformly_scaled (const MatT &mat)
template<typename T, int NumCol, int NumRow>
bool is_zero (const MatBase< T, NumCol, NumRow > &mat)
Implementation.
template<typename T, int NumCol, int NumRow>
bool is_unit_scale (const MatBase< T, NumCol, NumRow > &m)
template<typename T, int Size>
MatBase< T, Size, Size > invert (const MatBase< T, Size, Size > &mat)
template<typename T, int NumCol, int NumRow, typename AngleT>
MatBase< T, NumCol, NumRow > rotate (const MatBase< T, NumCol, NumRow > &mat, const AxisAngleBase< T, AngleT > &rotation)
template<typename T, int NumCol, int NumRow, int SrcNumCol, int SrcNumRow, int SrcStartCol, int SrcStartRow, int SrcAlignment>
MatBase< T, NumCol, NumRow > normalize (const MatView< T, NumCol, NumRow, SrcNumCol, SrcNumRow, SrcStartCol, SrcStartRow, SrcAlignment > &a)
template<typename T, int NumCol, int NumRow, int SrcNumCol, int SrcNumRow, int SrcStartCol, int SrcStartRow, int SrcAlignment, typename VectorT>
MatBase< T, NumCol, NumRow > normalize_and_get_size (const MatView< T, NumCol, NumRow, SrcNumCol, SrcNumRow, SrcStartCol, SrcStartRow, SrcAlignment > &a, VectorT &r_size)
template<typename T>
QuaternionBase< T > normalized_to_quaternion_safe (const MatBase< T, 3, 3 > &mat)
template<bool AllowNegativeScale, typename T, typename RotationT>
void to_loc_rot_scale_safe (const MatBase< T, 4, 4 > &mat, VecBase< T, 3 > &r_location, RotationT &r_rotation, VecBase< T, 3 > &r_scale)
template<typename T>
VecBase< T, 3 > transform_direction_transposed (const MatBase< T, 3, 3 > &mat, const VecBase< T, 3 > &direction)
template<typename T>
VecBase< T, 3 > transform_direction_transposed (const MatBase< T, 4, 4 > &mat, const VecBase< T, 3 > &direction)
template<typename T, int N, int NumRow>
VecBase< T, N > project_point (const MatBase< T, N+1, NumRow > &mat, const VecBase< T, N > &point)
template<typename T, int N, int NumRow>
VecBase< T, N > project_point_safe (const MatBase< T, N+1, NumRow > &mat, const VecBase< T, N > &point)
template float3 transform_point (const float3x3 &mat, const float3 &point)
template float3 transform_point (const float4x4 &mat, const float3 &point)
template float3 transform_direction (const float3x3 &mat, const float3 &direction)
template float3 transform_direction (const float4x4 &mat, const float3 &direction)
template float3 project_point (const float4x4 &mat, const float3 &point)
template float2 project_point (const float3x3 &mat, const float2 &point)
template float3 project_point_safe (const float4x4 &mat, const float3 &point)
template float2 project_point_safe (const float3x3 &mat, const float2 &point)
Quaternion functions.
template<typename T>
T dot (const QuaternionBase< T > &a, const QuaternionBase< T > &b)
template<typename T>
QuaternionBase< T > pow (const QuaternionBase< T > &q, const T &y)
template<typename T>
QuaternionBase< T > conjugate (const QuaternionBase< T > &a)
template<typename T>
QuaternionBase< T > canonicalize (const QuaternionBase< T > &q)
template<typename T>
QuaternionBase< T > invert (const QuaternionBase< T > &q)
template<typename T>
QuaternionBase< T > invert_normalized (const QuaternionBase< T > &q)
template<typename T>
QuaternionBase< T > normalize (const QuaternionBase< T > &q)
template<typename T>
QuaternionBase< T > normalize_and_get_length (const QuaternionBase< T > &q, T &out_length)
template<typename T>
QuaternionBase< T > interpolate (const QuaternionBase< T > &a, const QuaternionBase< T > &b, T t)
Test functions.
template<typename T>
bool is_zero (const QuaternionBase< T > &q)
template<typename T>
bool is_equal (const QuaternionBase< T > &a, const QuaternionBase< T > &b, const T epsilon=T(0))
template<typename T>
bool is_unit_scale (const QuaternionBase< T > &q)
Quaternion
template<typename T>
VecBase< T, 2 > interpolate_dot_slerp (const T t, const T cosom)
Dual-Quaternion
template<typename T>
DualQuaternionBase< T > normalize (const DualQuaternionBase< T > &dual_quat)
template<typename T>
VecBase< T, 3 > transform_point (const DualQuaternionBase< T > &dq, const VecBase< T, 3 > &point, MatBase< T, 3, 3 > *r_crazy_space_mat=nullptr)
template<typename T>
DualQuaternionBase< T > to_dual_quaternion (const MatBase< T, 4, 4 > &mat, const MatBase< T, 4, 4 > &basemat)
template<typename T>
bool is_normalized (const DualQuaternionBase< T > &dq)
Rotation helpers
template<typename T, typename RotT>
QuaternionBase< T > rotate (const QuaternionBase< T > &a, const RotT &b)
template<typename T, typename RotT, typename AngleT>
AxisAngleBase< T, AngleT > rotate (const AxisAngleBase< T, AngleT > &a, const RotT &b)
template<typename T, typename RotT>
EulerXYZBase< T > rotate (const EulerXYZBase< T > &a, const RotT &b)
template<typename T, typename RotT>
Euler3Base< T > rotate (const Euler3Base< T > &a, const RotT &b)
template<typename T>
QuaternionBase< T > rotation_between (const QuaternionBase< T > &a, const QuaternionBase< T > &b)
template<typename T>
QuaternionBase< T > from_triangle (const VecBase< T, 3 > &v1, const VecBase< T, 3 > &v2, const VecBase< T, 3 > &v3, const VecBase< T, 3 > &normal)
template<typename T>
QuaternionBase< T > from_triangle (const VecBase< T, 3 > &v1, const VecBase< T, 3 > &v2, const VecBase< T, 3 > &v3)
template<typename T>
QuaternionBase< T > from_vector (const VecBase< T, 3 > &vector, const AxisSigned track_flag, const Axis up_flag)
template<typename T>
QuaternionBase< T > from_tracking (AxisSigned forward_axis, Axis up_axis)
template<typename T>
MatBase< T, 3, 3 > to_gimbal_axis (const Euler3Base< T > &rotation)
Angles
template<typename T>
AngleRadianBase< T > angle_of (const QuaternionBase< T > &q)
template<typename T>
AngleRadianBase< T > angle_of_signed (const QuaternionBase< T > &q)
template<typename T>
AngleRadianBase< T > angle_between (const QuaternionBase< T > &a, const QuaternionBase< T > &b)
template<typename T>
AngleRadianBase< T > angle_between (const VecBase< T, 3 > &a, const VecBase< T, 3 > &b)
template<typename T>
AngleFraction< T > angle_between (const AxisSigned a, const AxisSigned b)
template<typename T>
AngleRadianBase< T > angle_between_signed (const QuaternionBase< T > &a, const QuaternionBase< T > &b)
float2 rotate_around_point_2d (const float2 p, const float2 pivot, const AngleRadian angle)
Conversion from Cartesian Basis
template<typename T>
QuaternionBase< T > to_quaternion (const CartesianBasis &rotation)
Explicit Template Instantiations
template EulerXYZ to_euler (const AxisAngle &)
template EulerXYZ to_euler (const AxisAngleCartesian &)
template EulerXYZ to_euler (const Quaternion &)
template Euler3 to_euler (const AxisAngle &, EulerOrder)
template Euler3 to_euler (const AxisAngleCartesian &, EulerOrder)
template Euler3 to_euler (const Quaternion &, EulerOrder)
template Quaternion to_quaternion (const AxisAngle &)
template Quaternion to_quaternion (const AxisAngleCartesian &)
template Quaternion to_quaternion (const Euler3 &)
template Quaternion to_quaternion (const EulerXYZ &)
template AxisAngleCartesian to_axis_angle (const Euler3 &)
template AxisAngleCartesian to_axis_angle (const EulerXYZ &)
template AxisAngleCartesian to_axis_angle (const Quaternion &)
Determinant
template float determinant (const float2x2 &mat)
template float determinant (const float3x3 &mat)
template float determinant (const float4x4 &mat)
template double determinant (const double2x2 &mat)
template double determinant (const double3x3 &mat)
template double determinant (const double4x4 &mat)
template bool is_negative (const float3x3 &mat)
template bool is_negative (const float4x4 &mat)
template bool is_negative (const double3x3 &mat)
template bool is_negative (const double4x4 &mat)
Adjoint
template float2x2 adjoint (const float2x2 &mat)
template float3x3 adjoint (const float3x3 &mat)
template float4x4 adjoint (const float4x4 &mat)
template double2x2 adjoint (const double2x2 &mat)
template double3x3 adjoint (const double3x3 &mat)
template double4x4 adjoint (const double4x4 &mat)
Inverse
template float2x2 invert (const float2x2 &mat, bool &r_success)
template float3x3 invert (const float3x3 &mat, bool &r_success)
template float4x4 invert (const float4x4 &mat, bool &r_success)
template double2x2 invert (const double2x2 &mat, bool &r_success)
template double3x3 invert (const double3x3 &mat, bool &r_success)
template double4x4 invert (const double4x4 &mat, bool &r_success)
template float2x2 pseudo_invert (const float2x2 &mat, float epsilon)
template float3x3 pseudo_invert (const float3x3 &mat, float epsilon)
template float4x4 pseudo_invert (const float4x4 &mat, float epsilon)
template double2x2 pseudo_invert (const double2x2 &mat, double epsilon)
template double3x3 pseudo_invert (const double3x3 &mat, double epsilon)
template double4x4 pseudo_invert (const double4x4 &mat, double epsilon)
Polar Decomposition
template<typename T>
static void polar_decompose (const MatBase< T, 3, 3 > &mat3, MatBase< T, 3, 3 > &r_U, MatBase< T, 3, 3 > &r_P)
Interpolate
template float3x3 interpolate (const float3x3 &a, const float3x3 &b, float t)
template double3x3 interpolate (const double3x3 &a, const double3x3 &b, double t)
template float4x4 interpolate (const float4x4 &a, const float4x4 &b, float t)
template double4x4 interpolate (const double4x4 &a, const double4x4 &b, double t)
template float3x3 interpolate_fast (const float3x3 &a, const float3x3 &b, float t)
template double3x3 interpolate_fast (const double3x3 &a, const double3x3 &b, double t)
template float4x4 interpolate_fast (const float4x4 &a, const float4x4 &b, float t)
template double4x4 interpolate_fast (const double4x4 &a, const double4x4 &b, double t)
Normal / Area
 TEST (math_geom_hh, NormalQuad)
 TEST (math_geom_hh, AreaTri)
 TEST (math_geom_hh, CotangentTriWeight)

Variables

template<typename T>
constexpr bool is_math_float_type = std::is_floating_point_v<T>
template<typename T>
constexpr bool is_math_integral_type = std::is_integral_v<T>
static const std::array< locus_entry_t, 31 > planck_locus

Typedef Documentation

◆ AngleCartesian

◆ AngleRadian

◆ AxisAngle

◆ AxisAngleCartesian

◆ DualQuaternion

◆ Euler3

Definition at line 435 of file BLI_math_euler_types.hh.

◆ EulerXYZ

◆ Quaternion

Enumeration Type Documentation

◆ eCubicFilter

enum class blender::math::eCubicFilter
strong
Enumerator
BSpline 
Mitchell 

Definition at line 25 of file math_interp.cc.

◆ EulerOrder

Enumerator
XYZ 
XZY 
YXZ 
YZX 
ZXY 
ZYX 

Definition at line 39 of file BLI_math_euler_types.hh.

◆ FilterKernel

enum class blender::math::FilterKernel
strong
Enumerator
Box 
Tent 
Quad 
Cubic 
Catrom 
Gauss 
Mitch 

Definition at line 13 of file BLI_math_filter.hh.

◆ InterpWrapMode

enum class blender::math::InterpWrapMode
strong

Texture coordinate wrapping mode.

Enumerator
Extend 

Image edges are extended outside the image, i.e. sample coordinates are clamped to the edge.

Repeat 

Image repeats, i.e. sample coordinates are wrapped around.

Border 

Samples outside the image return transparent black.

Definition at line 37 of file BLI_math_interp.hh.

Function Documentation

◆ abs() [1/3]

template<>
AxisSigned blender::math::abs ( const AxisSigned & axis)
inline

Definition at line 201 of file BLI_math_basis_types.hh.

References abs(), and blender::math::AxisSigned::axis().

◆ abs() [2/3]

template<typename T>
T blender::math::abs ( const T & a)
inline

Definition at line 33 of file BLI_math_base.hh.

References abs(), and T.

Referenced by abs(), abs(), abs(), blender::nodes::node_composite_glare_cc::GlareOperation::accumulate_ghosts_cpu(), almost_equal_relative(), angle_between(), blender::math::AngleCartesianBase< float >::AngleCartesianBase(), blender::apply_stroke_transform(), blender::ed::sculpt_paint::calc_brush_cube_distances(), blender::ed::sculpt_paint::filter::calc_sphere_translations(), blender::ed::sculpt_paint::pose::calc_squash_stretch_deform(), blender::bke::pbvh::pixels::can_be_extended(), blender::math::CartesianBasis::CartesianBasis(), blender::nodes::node_composite_chroma_key_cc::chroma_matte(), blender::ed::curves::clamp_to_zero(), blender::ed::sculpt_paint::clip_and_lock_translations(), blender::ed::sculpt_paint::clip_and_lock_translations(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_base_ghost_cpu(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_defocus_radius_from_depth_cpu(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_matte_cpu(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_maximum_diameter_of_circle_of_confusion(), blender::nodes::node_composite_vector_blur_cc::compute_motion_rect(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::compute_piecewise_linear_falloff(), blender::convexhull_2d_angle_iter_init(), cross(), blender::ed::greasepencil::decode_index(), blender::ed::greasepencil::segment::decode_index(), blender::deform_drawing(), blender::deform_drawing_as_envelope(), blender::nodes::node_composite_difference_key_cc::difference_matte(), dominant_axis(), blender::ED_view3d_effective_flip_axis(), blender::imbuf::transform::edge_aa(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic_cpu(), blender::nodes::node_composite_bokeh_blur_cc::BokehBlurOperation::execute_variable_size_cpu(), blender::geometry::extend_curve_curved(), blender::find_envelope(), blender::compositor::find_scale_factor(), blender::ed::spreadsheet::format_matrix_to_grid(), from_orthonormal_axes(), blender::ed::greasepencil::generate_arc_from_point_to_point(), blender::generate_vert_coordinates(), blender::get_factor_from_draw_speed(), blender::ed::greasepencil::segment::get_intersection_distance_of_segments(), blender::nodes::node_composite_dilate_erode_cc::DilateErodeOperation::get_structuring_element_size(), blender::compositor::horizontal_pass_cpu(), blender::compositor::horizontal_pass_gpu(), blender::draw::overlay::FlatObjectRef::if_flat_axis_orthogonal_to_view(), interpolate_dot_slerp(), blender::xpbd::intersect_plane(), is_equal(), is_equal(), is_equal(), blender::nodes::node_composite_vector_blur_cc::is_inside_motion_line(), is_orthogonal(), is_orthonormal(), is_similarity_transform(), is_uniformly_scaled(), is_unit(), is_unit_scale(), is_unit_scale(), is_zero(), blender::jpeg_density_from_ppm(), length_manhattan(), blender::geometry::geom::make_unit_square_map(), mod_periodic(), blender::compositor::morphological_distance(), blender::compositor::morphological_distance_gpu(), blender::geometry::profile::move_profile_plane(), blender::geometry::profile::move_weld_profile_planes(), blender::geometry::geom::nearly_parallel(), blender::geometry::construct::nearly_parallel_normalized(), blender::ed::sculpt_paint::node_in_box(), blender::math::detail::normalized_to_quat_fast(), blender::geometry::construct::offset_in_plane(), blender::geometry::geom::offset_meet(), blender::math::AngleFraction< T >::operator AngleCartesianBase< T >(), blender::noise::perlin_signed(), blender::noise::perlin_signed(), blender::noise::perlin_signed(), blender::noise::perlin_signed(), blender::geometry::construct::pipe_test(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), project_point(), project_point_safe(), blender::seq::query_thumbnail(), blender::math::AngleFraction< T >::radian(), blender::fn::multi_function::register_common_functions_impl(), rotation_between(), rotation_between(), blender::ed::vse::sequencer_snap_exec(), blender::ed::sculpt_paint::greasepencil::simplify_opacities(), blender::Bounds< T >::size(), blender::compositor::SMAABlendingWeightCalculationPS(), blender::compositor::SMAADecodeDiagBilinearAccess(), blender::compositor::SMAADecodeDiagBilinearAccess(), blender::compositor::SMAALumaEdgeDetectionPS(), blender::nodes::node_composite_glare_cc::GlareOperation::smooth_min(), blender::ed::transform::snap_object_context_runtime_init(), blender::geometry::construct::snap_to_superellipsoid(), blender::compositor::spectral_bokeh(), blender::eevee::IrradianceBake::surfels_create(), blender::math::QuaternionBase< T >::swing(), blender::math::tests::TEST(), blender::gpu::tests::test_mipmap_partial_matches_full(), to_axis_angle(), to_vector(), blender::transform_mpath_point_to_camera(), blender::geometry::construct::tri_corner_test(), blender::compositor::vertical_pass_cpu(), blender::compositor::vertical_pass_gpu(), blender::view3d_panel_curve_data(), and blender::math::AngleFraction< T >::wrapped().

◆ abs() [3/3]

template<typename T, int Size>
VecBase< T, Size > blender::math::abs ( const VecBase< T, Size > & a)
inlinenodiscard

Definition at line 38 of file BLI_math_vector.hh.

References abs(), and blender::result.

◆ acos()

template<typename T>
T blender::math::acos ( const T & a)
inline

Definition at line 189 of file BLI_math_base.hh.

References acos(), and T.

Referenced by acos(), blender::noise::compute_3d_orientation(), interpolate_dot_slerp(), and safe_acos().

◆ adjoint() [1/7]

template double2x2 blender::math::adjoint ( const double2x2 & mat)

References adjoint().

◆ adjoint() [2/7]

template double3x3 blender::math::adjoint ( const double3x3 & mat)

References adjoint().

◆ adjoint() [3/7]

template double4x4 blender::math::adjoint ( const double4x4 & mat)

References adjoint().

◆ adjoint() [4/7]

template float2x2 blender::math::adjoint ( const float2x2 & mat)

References adjoint().

◆ adjoint() [5/7]

template float3x3 blender::math::adjoint ( const float3x3 & mat)

References adjoint().

◆ adjoint() [6/7]

template float4x4 blender::math::adjoint ( const float4x4 & mat)

References adjoint().

◆ adjoint() [7/7]

template<typename T, int Size>
MatBase< T, Size, Size > blender::math::adjoint ( const MatBase< T, Size, Size > & mat)
nodiscard

Returns the adjoint of the matrix (also known as adjugate matrix).

Definition at line 165 of file math_matrix.cc.

References adjoint(), determinant(), T, and blender::unroll().

Referenced by adjoint(), adjoint(), adjoint(), adjoint(), adjoint(), adjoint(), and adjoint().

◆ almost_equal_relative()

template<typename T, int Size>
bool blender::math::almost_equal_relative ( const VecBase< T, Size > & a,
const VecBase< T, Size > & b,
const T & epsilon_factor )
inlinenodiscard

Returns true if the given vectors are equal within the given epsilon. The epsilon is scaled for each component by magnitude of the matching component of a.

Definition at line 25 of file BLI_math_vector.hh.

References abs(), almost_equal_relative(), b, distance(), and T.

Referenced by almost_equal_relative(), blender::bke::CurvesGeometry::evaluated_tangents(), and blender::io::grease_pencil::extend_curves_geometry().

◆ angle_between() [1/3]

template<typename T>
AngleFraction< T > blender::math::angle_between ( const AxisSigned a,
const AxisSigned b )
nodiscard

◆ angle_between() [2/3]

◆ angle_between() [3/3]

template<typename T>
AngleRadianBase< T > blender::math::angle_between ( const VecBase< T, 3 > & a,
const VecBase< T, 3 > & b )
nodiscard

◆ angle_between_signed()

template<typename T>
AngleRadianBase< T > blender::math::angle_between_signed ( const QuaternionBase< T > & a,
const QuaternionBase< T > & b )
nodiscard

Extract angle between 2 orientations. Returned angle is in [-pi..pi] range. See angle_of_signed for more detail.

Definition at line 182 of file BLI_math_rotation.hh.

References angle_between_signed(), angle_of_signed(), b, and rotation_between().

Referenced by angle_between_signed(), and blender::math::tests::TEST().

◆ angle_of()

template<typename T>
AngleRadianBase< T > blender::math::angle_of ( const QuaternionBase< T > & q)
nodiscard

Extract rotation angle from a unit quaternion. Returned angle is in [0..2pi] range.

Unlike the angle between vectors, this does NOT return the shortest angle. See angle_of_signed below for this.

Definition at line 125 of file BLI_math_rotation.hh.

References angle_of(), blender::BLI_assert(), is_unit_scale(), safe_acos(), T, and blender::math::QuaternionBase< T >::w.

Referenced by angle_between(), angle_of(), blender::nodes::node_fn_combine_transform_cc::CombineTransformFunction::call(), and blender::math::tests::TEST().

◆ angle_of_signed()

template<typename T>
AngleRadianBase< T > blender::math::angle_of_signed ( const QuaternionBase< T > & q)
nodiscard

Extract rotation angle from a unit quaternion. Always return the shortest angle. Returned angle is in [-pi..pi] range.

angle_of with quaternion can exceed PI radians. Having signed versions of these functions allows to use 'abs(angle_of_signed(...))' to get the shortest angle between quaternions with higher precision than subtracting 2pi afterwards.

Definition at line 139 of file BLI_math_rotation.hh.

References angle_of_signed(), blender::BLI_assert(), is_unit_scale(), safe_acos(), T, and blender::math::QuaternionBase< T >::w.

Referenced by angle_between_signed(), angle_of_signed(), and blender::math::tests::TEST().

◆ area_poly()

float blender::math::area_poly ( Span< float2 > verts)
inlinenodiscard

Compute the area of a 2D polygon given its vertices.

Definition at line 390 of file BLI_math_geom.hh.

References area_poly(), blender::area_poly_v2(), blender::Span< T >::data(), and blender::Span< T >::size().

Referenced by area_poly(), and TEST().

◆ area_tri()

template<typename T>
T blender::math::area_tri ( const VecBase< T, 3 > & v1,
const VecBase< T, 3 > & v2,
const VecBase< T, 3 > & v3 )
inlinenodiscard

Compute the area of a triangle (v1, v2, v3) in 3D space.

Definition at line 44 of file BLI_math_geom.hh.

References area_tri(), cross(), length(), T, and blender::v2.

Referenced by area_tri(), and TEST().

◆ asin()

template<typename T>
T blender::math::asin ( const T & a)
inline

Definition at line 258 of file BLI_math_base.hh.

References asin(), and T.

Referenced by asin().

◆ atan()

template<typename T>
T blender::math::atan ( const T & a)
inline

Definition at line 263 of file BLI_math_base.hh.

References atan(), and T.

Referenced by atan(), and blender::tests::TEST().

◆ atan2()

◆ average()

◆ axis_dominant_to_m3()

float3x3 blender::math::axis_dominant_to_m3 ( const float3 & normal)
inlinenodiscard

Build a 3x3 matrix whose rows map 3D coordinates so that the dominant two axes of normal become the X and Y columns, allowing vectors to be projected into the plane of normal.

Parameters
normalA unit-length vector.

Definition at line 224 of file BLI_math_geom.hh.

References axis_dominant_to_m3(), and blender::axis_dominant_v3_to_m3().

Referenced by axis_dominant_to_m3(), blender::geometry::construct::compute_face_interp_weights(), blender::geometry::construct::face_point_inside_test(), blender::geometry::construct::projected_boundary_area(), and TEST().

◆ barycentric_weights()

float3 blender::math::barycentric_weights ( const float2 & v1,
const float2 & v2,
const float2 & v3,
const float2 & co )
inlinenodiscard

Compute the barycentric weights of point co with respect to triangle (v1, v2, v3) in 2D.

Definition at line 355 of file BLI_math_geom.hh.

References barycentric_weights(), blender::barycentric_weights_v2(), blender::v2, and w().

Referenced by barycentric_weights(), and TEST().

◆ bicubic_interpolation()

◆ bilinear_byte_impl()

template<bool border>
BLI_INLINE uchar4 blender::math::bilinear_byte_impl ( const uchar * buffer,
int width,
int height,
float u,
float v )

◆ canonicalize()

template<typename T>
QuaternionBase< T > blender::math::canonicalize ( const QuaternionBase< T > & q)
inlinenodiscard

◆ ceil() [1/2]

template<typename T>
T blender::math::ceil ( const T & a)
inline

Definition at line 138 of file BLI_math_base.hh.

References ceil(), and T.

Referenced by blender::bke::compositor::add_passes_used_by_cryptomatte_node(), blender::seq::apply_word_wrapping(), blender::seq::calc_boundbox(), ceil(), ceil(), blender::nodes::node_composite_vector_blur_cc::compute_motion_rect(), blender::compositor::compute_output_domain(), blender::deform_drawing(), blender::compositor::deriche_gaussian_blur(), blender::ed::vse::draw_strip_thumbnails(), blender::nodes::node_composite_defocus_cc::DefocusOperation::execute(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic_cpu(), blender::nodes::node_composite_blur_cc::BlurOperation::execute_constant_size(), blender::nodes::node_composite_dilate_erode_cc::DilateErodeOperation::execute_step_pass_cpu(), blender::nodes::node_composite_blur_cc::BlurOperation::execute_variable_size(), blender::geometry::extend_curve_curved(), blender::geometry::extend_curve_straight(), blender::geometry::extend_curves(), blender::seq::final_image_cache_invalidate_frame_range(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::get_iterations(), blender::nodes::node_composite_cryptomatte_cc::CryptoMatteOperation::get_layers_from_render(), blender::TimeMapping::local_frame_after_scene_frame(), blender::eevee::Film::overscan_pixels_get(), blender::compositor::Domain::realize_transformation(), blender::fn::multi_function::register_common_functions_impl(), blender::geometry::sample_curve_padded(), blender::TimeMapping::scene_frame_after_local_frame(), blender::compositor::symmetric_separable_blur(), blender::compositor::SymmetricBlurWeights::SymmetricBlurWeights(), blender::compositor::SymmetricSeparableBlurWeights::SymmetricSeparableBlurWeights(), blender::table_sample(), blender::bke::pbvh::TriRasterizer::TriRasterizer(), blender::compositor::van_vliet_gaussian_blur(), and blender::nodes::node_composite_vector_blur_cc::velocity_atomic_max_value().

◆ ceil() [2/2]

template<typename T, int Size>
VecBase< T, Size > blender::math::ceil ( const VecBase< T, Size > & a)
inlinenodiscard

Definition at line 370 of file BLI_math_vector.hh.

References BLI_UNROLL_MATH_VEC_OP_VEC, and ceil().

◆ ceil_to_multiple()

template<typename T, int Size>
VecBase< T, Size > blender::math::ceil_to_multiple ( const VecBase< T, Size > & a,
const VecBase< T, Size > & b )
inlinenodiscard

Returns a if it is a multiple of b or the next multiple or b after a . In other words, it is equivalent to divide_ceil(a, b) * b. It is undefined if a is negative or b is not strictly positive.

Definition at line 302 of file BLI_math_vector.hh.

References b, blender::BLI_assert(), ceil_to_multiple(), and blender::result.

Referenced by ceil_to_multiple(), blender::eevee::DepthOfField::render(), blender::eevee::RayTraceModule::render(), blender::eevee::DepthOfField::sync(), blender::eevee::HiZBuffer::sync(), and blender::tests::TEST().

◆ chromatic_adaption_matrix()

◆ clamp() [1/3]

template<typename T>
T blender::math::clamp ( const T & a,
const T & min,
const T & max )
inline

Definition at line 69 of file BLI_math_base.hh.

References clamp(), max(), min(), and T.

Referenced by blender::nodes::node_composite_alpha_over_cc::alpha_over(), blender::nodes::node_composite_alpha_over_cc::alpha_over_conjoint(), blender::nodes::node_composite_alpha_over_cc::alpha_over_disjoint(), blender::seq::HueCorrectApplyOp::apply(), blender::ed::sculpt_paint::greasepencil::WeightPaintOperation::apply_weight_to_point(), bilinear_byte_impl(), blender::nodes::node_composite_box_mask_cc::box_mask(), blender::imbuf::transform::calc_coverage(), blender::calc_min_radius_v3v3(), blender::nodes::node_shader_radial_tiling_cc::RoundedPolygonFunction::call(), blender::nodes::node_shader_tex_gradient_cc::GradientFunction::call(), blender::nodes::node_shader_tex_noise_cc::NoiseFunction::call(), clamp(), clamp(), clamp(), blender::seq::clamp_rect(), blender::xpbd::closest_on_segment_to_ray(), blender::ed::sculpt_paint::color::color_filter_task(), blender::nodes::node_composite_crop_cc::CropOperation::compute_cropping_bounds(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_defocus_radius_from_scale_cpu(), blender::compositor::compute_marker_points(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_matte_cpu(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_tweaked_matte_cpu(), blender::create_envelope_stroke_for_point(), blender::nodes::node_composite_rgb_curves_cc::curves_rgba(), blender::io::gsplat::OriginalActivationFunctions::decode_opacity(), blender::deform_drawing(), blender::nodes::node_composite_vector_blur_cc::depth_compare(), blender::bke::pbvh::pixels::do_encode_pixels(), blender::ed::sculpt_paint::color::do_paint_brush(), blender::ed::sculpt_paint::color::do_paint_brush_task(), blender::do_version_glare_node_options_to_inputs(), blender::draw_current_frame(), blender::draw::drw_particle_get_hair_source(), blender::nodes::node_composite_ellipse_mask_cc::ellipse_mask(), blender::nodes::node_composite_time_curves_cc::TimeCurveOperation::execute(), blender::geometry::extend_curve_curved(), blender::seq::fill_rect_alpha_under(), blender::ed::greasepencil::fit_strokes_to_view(), blender::ed::vse::ScopeHistogram::float_to_bin(), float_to_half_clamp_array(), blender::seq::freeze_key_pair_create(), blender::noise::gabor(), blender::noise::gabor(), blender::ed::greasepencil::get_active_frame_for_falloff(), blender::nodes::node_composite_keying_cc::KeyingOperation::get_black_level(), blender::get_build_factor(), blender::nodes::node_composite_bokeh_image_cc::BokehImageOperation::get_catadioptric_size(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::get_center(), blender::nodes::node_composite_tone_map_cc::ToneMapOperation::get_chromatic_adaptation(), blender::nodes::node_composite_glare_cc::GlareOperation::get_color_modulation(), blender::nodes::node_composite_bokeh_image_cc::BokehImageOperation::get_color_shift(), blender::nodes::node_composite_anti_aliasing_cc::AntiAliasingOperation::get_corner_rounding(), blender::nodes::node_composite_keying_cc::KeyingOperation::get_despill_balance(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::get_eccentricity(), blender::nodes::node_composite_keying_cc::KeyingOperation::get_edge_tolerance(), blender::get_factor_from_draw_speed(), blender::nodes::node_composite_glare_cc::GlareOperation::get_fade(), blender::nodes::node_composite_bokeh_image_cc::BokehImageOperation::get_flaps(), blender::nodes::node_composite_glare_cc::GlareOperation::get_jitter_factor(), blender::nodes::node_composite_keying_cc::KeyingOperation::get_key_balance(), blender::nodes::node_composite_tone_map_cc::ToneMapOperation::get_light_adaptation(), blender::nodes::node_composite_mask_cc::MaskOperation::get_motion_blur_samples(), blender::nodes::node_composite_plane_track_deform_cc::PlaneTrackDeformOperation::get_motion_blur_samples(), blender::nodes::node_composite_mask_cc::MaskOperation::get_motion_blur_shutter(), blender::nodes::node_composite_plane_track_deform_cc::PlaneTrackDeformOperation::get_motion_blur_shutter(), blender::nodes::node_sh_mix_cc::get_multi_function(), blender::nodes::node_composite_despeckle_cc::DespeckleOperation::get_neighbor_threshold(), blender::nodes::node_composite_glare_cc::GlareOperation::get_number_of_iterations(), blender::nodes::node_composite_glare_cc::GlareOperation::get_number_of_streaks(), blender::nodes::node_composite_bokeh_image_cc::BokehImageOperation::get_roundness(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::get_samples(), blender::nodes::node_composite_vector_blur_cc::VectorBlurOperation::get_samples_count(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::get_sharpness(), blender::nodes::node_composite_glare_cc::GlareOperation::get_size(), blender::nodes::node_composite_keying_screen_cc::KeyingScreenOperation::get_smoothness(), blender::nodes::node_composite_anti_aliasing_cc::AntiAliasingOperation::get_threshold(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::get_translation_amount(), blender::nodes::node_composite_keying_cc::KeyingOperation::get_white_level(), blender::nodes::gizmos::gizmo_node_split_prop_matrix_set(), blender::draw::grease_pencil_weight_batch_ensure(), blender::nodes::node_composite_hue_correct_cc::hue_correct(), blender::imb_working_space_convert(), blender::seq::initialize_shadow_alpha(), blender::isect_vert_calc_z(), blender::ed::curves::pen_tool::line_segment_closest_point(), blender::compositor::Result::load_pixel_extended(), blender::nodes::node_composite_luminance_key_cc::luminance_matte(), blender::ed::sculpt_paint::node_in_sphere(), blender::ed::greasepencil::normalize_vertex_weights_try(), blender::ed::sculpt_paint::greasepencil::RandomizeOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexSmearOperation::on_stroke_extended(), blender::openexr_jpg_like_quality_to_dwa_compression_level(), blender::draw::detail::pack_gaussian(), blender::draw::detail::pack_radiance(), blender::nodes::node_composite_posterize_cc::posterize(), blender::nodes::node_composite_alpha_over_cc::preprocess_foreground(), blender::imbuf::transform::process_scanlines(), blender::project_face_pixel(), blender::project_paint_PickColor(), blender::ed::greasepencil::randomize_opacity(), blender::fn::multi_function::register_common_functions_impl(), blender::seq::retiming_add_transition(), blender::geometry::ReverseUVSampler::sample(), blender::ed::sculpt_paint::sample_texture_paint_color(), blender::compositor::sanitize_domain_data_size(), ScalingRange::scale_to_unit(), blender::ed::vse::sequencer_draw_scopes(), blender::ed::vse::sequencer_generic_invoke_xy_guess_channel(), blender::io::fbx::set_bsdf_color_param(), blender::io::fbx::set_bsdf_float_param(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::nodes::node_composite_vector_blur_cc::spread_compare(), blender::tests::TEST(), blender::tests::TEST(), blender::seq::transition_fader_calc(), blender::bke::pbvh::TriRasterizer::TriRasterizer(), blender::version_503_camera_view_fit(), blender::ed::greasepencil::weight_sample_invoke(), whitepoint_from_temp_tint(), blender::nodes::node_composite_glare_cc::GlareOperation::write_glare_output_cpu(), blender::io::ply::write_vertices(), and blender::write_weights_for_drawing().

◆ clamp() [2/3]

template<typename T, int Size>
VecBase< T, Size > blender::math::clamp ( const VecBase< T, Size > & a,
const T & min,
const T & max )
inlinenodiscard

Definition at line 131 of file BLI_math_vector.hh.

References clamp(), max(), min(), blender::result, and T.

◆ clamp() [3/3]

template<typename T, int Size>
VecBase< T, Size > blender::math::clamp ( const VecBase< T, Size > & a,
const VecBase< T, Size > & min,
const VecBase< T, Size > & max )
inlinenodiscard

Definition at line 119 of file BLI_math_vector.hh.

References clamp(), max(), min(), and blender::result.

◆ closest_to_line_segment()

template<typename T, int Size>
VecBase< T, Size > blender::math::closest_to_line_segment ( const VecBase< T, Size > & p,
const VecBase< T, Size > & l1,
const VecBase< T, Size > & l2 )
inlinenodiscard

◆ closest_to_plane()

template<typename T>
VecBase< T, 3 > blender::math::closest_to_plane ( const VecBase< T, 4 > & plane,
const VecBase< T, 3 > & pt )
inlinenodiscard

Closest point on a plane to pt.

Note
The plane normal need not be unit length. For unit normals, prefer closest_to_plane_normalized which avoids a division.

Definition at line 161 of file BLI_math_geom.hh.

References closest_to_plane(), length_squared(), plane_point_side(), and T.

Referenced by closest_to_plane(), blender::geometry::construct::snap_to_pipe_profile(), and TEST().

◆ closest_to_plane_normalized()

template<typename T>
VecBase< T, 3 > blender::math::closest_to_plane_normalized ( const VecBase< T, 4 > & plane,
const VecBase< T, 3 > & pt )
inlinenodiscard

Closest point on a plane to pt, for a plane with unit-length normal.

Note
The plane normal (plane.x, plane.y, plane.z) must be unit length.

Definition at line 147 of file BLI_math_geom.hh.

References closest_to_plane_normalized(), and dot().

Referenced by closest_to_plane_normalized(), blender::geometry::geom::offset_meet(), and TEST().

◆ conjugate()

template<typename T>
QuaternionBase< T > blender::math::conjugate ( const QuaternionBase< T > & a)
inlinenodiscard

Return the conjugate of the given quaternion. If the quaternion q represent the rotation from A to B, then the conjugate of q represents the rotation from B to A.

Definition at line 223 of file BLI_math_quaternion.hh.

References conjugate(), blender::math::QuaternionBase< T >::w, blender::math::QuaternionBase< T >::x, blender::math::QuaternionBase< T >::y, and blender::math::QuaternionBase< T >::z.

Referenced by conjugate(), blender::xpbd::evaluate_align_rotations_constraint(), from_triangle(), invert(), invert_normalized(), blender::math::tests::TEST(), to_quaternion_legacy(), and transform_point().

◆ cos() [1/4]

template<typename T>
T blender::math::cos ( const AngleCartesianBase< T > & a)

Definition at line 697 of file BLI_math_angle_types.hh.

References blender::math::AngleCartesianBase< T >::cos(), cos(), and T.

◆ cos() [2/4]

template<typename T>
T blender::math::cos ( const AngleFraction< T > & a)

Definition at line 710 of file BLI_math_angle_types.hh.

References cos(), and T.

◆ cos() [3/4]

template<typename T>
T blender::math::cos ( const AngleRadianBase< T > & a)

Definition at line 684 of file BLI_math_angle_types.hh.

References cos(), blender::math::AngleRadianBase< T >::radian(), and T.

Referenced by blender::math::AngleRadianBase< float >::AngleRadianBase(), blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), blender::noise::compute_2d_gabor_kernel(), blender::noise::compute_3d_gabor_kernel(), blender::noise::compute_3d_orientation(), blender::compositor::compute_denominator_1(), blender::compositor::compute_denominator_2(), blender::compositor::compute_denominator_3(), blender::compositor::compute_numerator_1(), blender::compositor::compute_numerator_2(), blender::compositor::compute_numerator_3(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_streak_direction(), cos(), cos(), cos(), cos(), blender::bke::tests::GreasePencilInterpolate::create_test_shape(), blender::bke::curve_to_mesh_sweep(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic_cpu(), blender::nodes::node_composite_box_mask_cc::BoxMaskOperation::execute_cpu(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::execute_cpu(), blender::nodes::node_composite_ellipse_mask_cc::EllipseMaskOperation::execute_cpu(), blender::nodes::node_composite_split_cc::SplitOperation::execute_cpu(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::execute_gpu(), blender::nodes::node_composite_split_cc::SplitOperation::execute_gpu(), blender::workbench::filter_blackman_harris(), blender::geometry::profile::find_even_superellipse_chords(), blender::math::detail::from_rotation(), blender::math::detail::from_rotation(), blender::math::detail::from_rotation(), from_triangle(), blender::ed::greasepencil::generate_arc_from_point_to_point(), blender::ed::greasepencil::generate_circle_from_point(), blender::ed::greasepencil::generate_corner(), blender::compositor::get_regular_polygon_vertex_position(), blender::ed::greasepencil::grease_pencil_primitive_rotate_all_update(), blender::workbench::SceneResources::load_jitter_tx(), blender::geometry::geom::offset_meet(), blender::math::AngleFraction< T >::operator AngleCartesianBase< T >(), pow(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), blender::draw::overlay::ring_vertices(), rotate(), blender::ed::sculpt_paint::greasepencil::rotate_by_angle(), blender::rotate_by_angle(), blender::math::tests::TEST(), to_quaternion(), to_quaternion(), to_quaternion_legacy(), and blender::write_fill_transforms().

◆ cos() [4/4]

template<typename T>
T blender::math::cos ( const T & a)
inline

Definition at line 174 of file BLI_math_base.hh.

References cos(), and T.

◆ cotangent_tri_weight()

template<typename T>
T blender::math::cotangent_tri_weight ( const VecBase< T, 3 > & v1,
const VecBase< T, 3 > & v2,
const VecBase< T, 3 > & v3 )
inlinenodiscard

Compute the cotangent of the angle at vertex v1 in the triangle (v1, v2, v3). Returns 0 for degenerate triangles.

Definition at line 56 of file BLI_math_geom.hh.

References b, cotangent_tri_weight(), cross(), dot(), length(), T, and blender::v2.

Referenced by cotangent_tri_weight(), and TEST().

◆ cross() [1/3]

AxisSigned blender::math::cross ( const AxisSigned a,
const AxisSigned b )
inlinenodiscard

Returns the cross direction from two basis direction using the right hand rule. This is much faster than true cross product if the vectors are basis vectors. Any ill-formed case will return a orthogonal axis to a but will also trigger an assert. It is better to filter these cases upstream.

Definition at line 217 of file BLI_math_basis_types.hh.

References abs(), b, BLI_assert_msg, cross(), blender::math::AxisSigned::next_after(), blender::math::AxisSigned::X_NEG, blender::math::AxisSigned::X_POS, blender::math::AxisSigned::Y_NEG, blender::math::AxisSigned::Y_POS, blender::math::AxisSigned::Z_NEG, and blender::math::AxisSigned::Z_POS.

Referenced by blender::meshintersect::add_face_constraints(), area_tri(), blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), blender::ed::sculpt_paint::boundary::bend_data_init_bmesh(), blender::ed::sculpt_paint::boundary::bend_data_init_grids(), blender::ed::sculpt_paint::boundary::bend_data_init_mesh(), blender::BKE_multires_construct_tangent_matrix(), blender::bmo_circularize_exec(), blender::bke::build_point_matrix(), blender::ed::sculpt_paint::brushes::clay_strips::calc_local_matrix(), blender::bke::curves::poly::calculate_next_normal(), blender::ed::sculpt_paint::min_distance_edit::calculate_points_per_side(), blender::nodes::node_fn_axes_to_rotation_cc::AxesToRotationFunction::call(), blender::ed::sculpt_paint::cloth::cloth_brush_apply_brush_forces(), blender::bke::mesh::corner_fan_space_define(), cotangent_tri_weight(), blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_points(), blender::nodes::node_geo_curve_primitive_circle_cc::create_point_circle_curve(), blender::nodes::node_geo_scale_elements_cc::create_single_axis_transform(), cross(), cross(), cross(), cross_tri(), blender::deform_drawing(), blender::bke::curves::poly::direction_bisect(), blender::ed::sculpt_paint::brushes::do_clay_thumb_brush(), blender::ed::sculpt_paint::brushes::do_multiplane_scrape_brush(), blender::ed::sculpt_paint::brushes::do_nudge_brush(), blender::ed::sculpt_paint::brushes::do_pinch_brush(), blender::ed::sculpt_paint::brushes::do_plane_brush(), blender::ed::sculpt_paint::brushes::do_thumb_brush(), blender::geometry::construct::edges_angle_kind(), blender::bke::subdiv::eval_limit_point_and_normal(), blender::geometry::extend_curve_curved(), from_orthonormal_axes(), from_orthonormal_axes(), from_vector(), blender::generate_curves(), blender::gizmo_ruler_draw(), blender::ed::greasepencil::grease_pencil_texture_gradient_exec(), blender::draw::overlay::FlatObjectRef::if_flat_axis_orthogonal_to_view(), blender::xpbd::intersect_plane(), isect_point_quad(), isect_point_tri(), blender::geometry::construct::make_cube_corner_adj_vmesh(), blender::ed::view3d::geometry_nodes_gizmos::make_matrix_orthonormal_but_keep_z_axis(), blender::geometry::geom::make_unit_square_map(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_draw(), blender::geometry::profile::move_profile_plane(), blender::geometry::profile::move_weld_profile_planes(), blender::ed::sculpt_paint::node_in_box(), normal_quad(), blender::geometry::construct::offset_in_plane(), blender::geometry::geom::offset_meet(), orthogonalize(), blender::geometry::geom::point_between_edges(), rotate_direction_around_axis(), blender::bke::mesh_surface_sample::sample_surface_points_spherical(), blender::geometry::profile::set_profile_params(), blender::seq::strip_result_covers_strip_quad(), blender::ed::transform::transform_mesh_edge_slide_data_create(), blender::geometry::construct::tri_corner_test(), and blender::bke::pbvh::TriRasterizer::TriRasterizer().

◆ cross() [2/3]

template<typename T>
T blender::math::cross ( const VecBase< T, 2 > & a,
const VecBase< T, 2 > & b )
inlinenodiscard

Definition at line 549 of file BLI_math_vector.hh.

References b, cross(), and T.

◆ cross() [3/3]

template<typename T>
VecBase< T, 3 > blender::math::cross ( const VecBase< T, 3 > & a,
const VecBase< T, 3 > & b )
inlinenodiscard
Returns
cross perpendicular vector to a and b.
Note
Return zero vector if a and b are collinear.
The length of the resulting vector is equal to twice the area of the triangle between a and b ; and it is equal to the sine of the angle between a and b if they are normalized.
Blender 3D space uses right handedness: a = thumb, b = index, return = middle.

Definition at line 563 of file BLI_math_vector.hh.

References b, and cross().

◆ cross_high_precision()

◆ cross_poly()

template<typename T>
VecBase< T, 3 > blender::math::cross_poly ( Span< VecBase< T, 3 > > poly)
inlinenodiscard
Parameters
polyArray of points around a polygon. They don't have to be co-planar.
Returns
Best fit plane normal for the given polygon loop or zero vector if point array is too short. Not normalized.

Definition at line 584 of file BLI_math_vector.hh.

References cross_poly().

Referenced by cross_poly(), and blender::get_dupliface_transform_from_coords().

◆ cross_tri()

template<typename T>
VecBase< T, 3 > blender::math::cross_tri ( const VecBase< T, 3 > & v1,
const VecBase< T, 3 > & v2,
const VecBase< T, 3 > & v3 )
inlinenodiscard

Return normal vector to a triangle. The result is not normalized and can be degenerate.

Definition at line 612 of file BLI_math_vector.hh.

References cross(), cross_tri(), and blender::v2.

Referenced by cross_tri(), and normal_tri().

◆ cube()

template<typename T>
T blender::math::cube ( const T & a)
inline

Definition at line 214 of file BLI_math_base.hh.

References cube(), and T.

Referenced by blender::compositor::compute_fog_glow_kernel_value(), and cube().

◆ cubic_filter_coefficients()

template<enum eCubicFilter filter>
float4 blender::math::cubic_filter_coefficients ( float f)
static

Definition at line 32 of file math_interp.cc.

References BSpline, cubic_filter_coefficients(), and Mitchell.

Referenced by bicubic_interpolation(), and cubic_filter_coefficients().

◆ determinant() [1/7]

template double blender::math::determinant ( const double2x2 & mat)

References determinant().

◆ determinant() [2/7]

template double blender::math::determinant ( const double3x3 & mat)

References determinant().

◆ determinant() [3/7]

template double blender::math::determinant ( const double4x4 & mat)

References determinant().

◆ determinant() [4/7]

template float blender::math::determinant ( const float2x2 & mat)

References determinant().

◆ determinant() [5/7]

template float blender::math::determinant ( const float3x3 & mat)

References determinant().

◆ determinant() [6/7]

template float blender::math::determinant ( const float4x4 & mat)

References determinant().

◆ determinant() [7/7]

◆ dist_squared_to_line_segment()

template<typename T, int Size>
T blender::math::dist_squared_to_line_segment ( const VecBase< T, Size > & p,
const VecBase< T, Size > & l1,
const VecBase< T, Size > & l2 )
inlinenodiscard

Squared distance from point p to the line segment (l1, l2). Works for any number of dimensions Size.

Definition at line 134 of file BLI_math_geom.hh.

References closest_to_line_segment(), dist_squared_to_line_segment(), length_squared(), and T.

Referenced by dist_squared_to_line_segment(), blender::geometry::construct::find_closer_edge(), blender::geometry::construct::projected_boundary_area(), TEST(), and TEST().

◆ dist_squared_to_plane()

template<typename T>
T blender::math::dist_squared_to_plane ( const VecBase< T, 3 > & p,
const VecBase< T, 4 > & plane )
inlinenodiscard

Squared distance from point p to plane.

Note
The plane normal need not be unit length.

Definition at line 176 of file BLI_math_geom.hh.

References dist_squared_to_plane(), length_squared(), plane_point_side(), and T.

Referenced by blender::geometry::construct::build_boundary_terminal_edge(), dist_squared_to_plane(), and TEST().

◆ distance() [1/2]

template<typename T>
T blender::math::distance ( const T & a,
const T & b )
inline

Definition at line 143 of file BLI_math_base.hh.

References b, distance(), and T.

Referenced by blender::nodes::node_composite_glare_cc::GlareOperation::accumulate_ghosts_cpu(), blender::length_parameterize::accumulate_lengths(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::active_smoothing(), blender::nodes::node_composite_glare_cc::GlareOperation::adaptive_smooth_clamp(), blender::geometry::add_curves_on_mesh(), blender::ed::sculpt_paint::greasepencil::WeightPaintOperation::add_point_under_brush_to_brush_buffer(), almost_equal_relative(), blender::bmo_fit_edge_loops_to_annotation_exec(), blender::ed::sculpt_paint::greasepencil::brush_point_influence(), blender::geometry::build_point_to_sample_map(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_bmesh(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_grids(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_mesh(), blender::ed::sculpt_paint::trim::calc_expand_factor(), blender::seq::calc_wipe_blend(), blender::bke::curves::bezier::calculate_aligned_handle(), blender::calculate_alignment_distance(), blender::calculate_circle_inside_fit(), blender::ed::space_node::calculate_inner_link_bezier_points(), blender::calculate_verts(), blender::nodes::node_geo_proximity_cc::ProximityFunction::call(), blender::ed::sculpt_paint::greasepencil::closest_distance_to_surface_2d(), blender::ed::sculpt_paint::cloth::cloth_brush_add_length_constraint(), blender::ed::sculpt_paint::cloth::cloth_brush_simulation_falloff_get(), blender::ed::sculpt_paint::mask::color_delta_get(), blender::nodes::node_composite_color_key_cc::color_matte(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_base_ghost_cpu(), blender::nodes::node_composite_double_edge_mask_cc::DoubleEdgeMaskOperation::compute_gradient_cpu(), blender::nodes::node_composite_lens_distortion_cc::compute_number_of_integration_steps(), blender::ed::sculpt_paint::ScaleCurvesEffect::compute_poly_curve_length(), blender::geometry::curve_constraints::compute_segment_lengths(), blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_points(), blender::nodes::node_geo_curve_primitive_circle_cc::create_point_circle_curve(), blender::ed::transform::curves::curve_connected_point_distances(), blender::ed::sculpt_paint::CutOperationExecutor::cut_curves(), blender::ed::transform::curves::cyclic_curve_connected_point_distances(), blender::deform_drawing(), distance(), distance(), blender::nodes::node_composite_distance_key_cc::distance_key(), blender::distance_to_closest_point(), blender::ed::sculpt_paint::color::do_smear_brush_task(), blender::dynamic_paint_paint_mesh_cell_point_cb_ex(), blender::ed::sculpt_paint::boundary::edit_data_init_bmesh(), blender::ed::sculpt_paint::boundary::edit_data_init_grids(), blender::ed::sculpt_paint::boundary::edit_data_init_mesh(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_sun_beams_cpu(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::fill_inpainting_region_cpu(), blender::geometry::construct::fill_profile_fracs(), blender::geometry::construct::fill_vmesh_fracs(), blender::bke::pbvh::pixels::Rows::filter_pixels_for_closer_examination(), blender::ed::vse::find_closest_cursor_offset(), blender::bke::pbvh::pixels::Rows::find_copy_source(), blender::ed::greasepencil::find_curve_intersections(), blender::ed::sculpt_paint::SlideOperationExecutor::find_curves_to_slide(), blender::find_envelope(), blender::bke::pbvh::pixels::Rows::find_second_source(), blender::ed::space_node::find_socket_at_mouse_y(), blender::ed::space_node::find_visible_center_of_link(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_projected(), blender::get_distance_factor(), blender::bke::greasepencil::Layer::get_frame_duration_at(), blender::ed::greasepencil::segment::get_intersection_distance_of_segments(), blender::nodes::node_geo_input_cluster_by_connected_cc::ClusterByConnectedFieldInput::get_varray_for_context(), blender::gizmo_ruler_draw(), blender::ed::sculpt_paint::grease_pencil_fill_event_modal_map(), blender::ed::sculpt_paint::grease_pencil_fill_extension_cut(), blender::ed::sculpt_paint::grease_pencil_fill_modal(), blender::ed::greasepencil::grease_pencil_primitive_update_curves(), blender::ed::sculpt_paint::pose::ik_chain_origin_heads_init(), blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::init_auto_masking(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::intersections_segment_circle_integers(), blender::geometry::limit_radius(), blender::ed::greasepencil::boolean::LR_states_from_segment(), blender::ed::sculpt_paint::mask::mask_by_color_contiguous_mesh(), blender::ed::sculpt_paint::mesh_cursor_active_draw(), blender::mesh_remap_bvh_query_nearest(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_draw(), blender::modify_geometry_set(), blender::ed::sculpt_paint::move_last_point_and_resample(), blender::ed::space_node::node_find_indicated_socket(), blender::ed::sculpt_paint::greasepencil::VertexSmearOperation::on_stroke_extended(), blender::geometry::perpendicular_distance(), blender::ed::greasepencil::polyline_fit_curve(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), blender::ed::sculpt_paint::PuffOperationExecutor::puff(), blender::ed::sculpt_paint::raycast_init(), blender::fn::multi_function::register_common_functions_impl(), blender::reorder_strokes(), blender::ed::sculpt_paint::sample_curves_3d_brush(), blender::ed::sculpt_paint::dyntopo::sample_detail_voxel(), blender::ed::sculpt_paint::DensityAddOperationExecutor::sample_projected_with_symmetry(), blender::ed::sculpt_paint::DensityAddOperationExecutor::sample_spherical_with_symmetry(), blender::draw::View::screen_pixel_radius(), blender::ed::sculpt_paint::screen_space_overlays_draw(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::segment_intersections_and_points_sides(), blender::ed::greasepencil::select_similar_exec(), blender::ed::sculpt_paint::greasepencil::simplify_opacities(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::ed::greasepencil::subdivide_last_segment(), blender::draw::test_draw_curves_interpolate_position(), blender::length_parameterize::tests::test_uniform_lengths(), blender::ed::sculpt_paint::transform_brush_radius(), blender::ed::transform::transform_mesh_edge_slide_data_create(), blender::ed::transform::transform_mesh_uv_edge_slide_data_create(), blender::ed::sculpt_paint::pose::vert_inside_brush_radius(), blender::noise::voronoi_distance(), blender::noise::voronoi_distance(), blender::noise::voronoi_distance(), blender::noise::voronoi_n_sphere_radius(), blender::noise::voronoi_n_sphere_radius(), blender::noise::voronoi_n_sphere_radius(), and blender::wm_xr_navigation_teleport_arc_scene_intersect().

◆ distance() [2/2]

template<typename T, int Size>
T blender::math::distance ( const VecBase< T, Size > & a,
const VecBase< T, Size > & b )
inlinenodiscard

Definition at line 486 of file BLI_math_vector.hh.

References b, distance(), length(), and T.

◆ distance_manhattan()

template<typename T, int Size>
T blender::math::distance_manhattan ( const VecBase< T, Size > & a,
const VecBase< T, Size > & b )
inlinenodiscard

◆ distance_squared()

template<typename T, int Size>
T blender::math::distance_squared ( const VecBase< T, Size > & a,
const VecBase< T, Size > & b )
inlinenodiscard

Definition at line 480 of file BLI_math_vector.hh.

References b, distance_squared(), length_squared(), and T.

Referenced by blender::ed::greasepencil::add_armature_automatic_weights(), blender::ed::sculpt_paint::cloth::add_constraints_for_verts(), blender::ed::spreadsheet::apply_row_filter(), blender::BKE_shrinkwrap_find_nearest_surface(), blender::ed::transform::bm_loop_uv_calc_opposite_co(), blender::bmo_fit_edge_loops_to_annotation_exec(), blender::ed::sculpt_paint::greasepencil::brush_point_influence_mask(), blender::tests::brute_force_sorted(), blender::ed::sculpt_paint::calc_brush_distances_squared(), blender::ed::sculpt_paint::calc_brush_distances_squared(), blender::ed::sculpt_paint::pose::calc_pose_origin_and_factor_bmesh(), blender::ed::sculpt_paint::pose::calc_pose_origin_and_factor_grids(), blender::ed::sculpt_paint::pose::calc_pose_origin_and_factor_mesh(), blender::geometry::quad::calc_quad_directions(), blender::calculate_circle_inside_fit(), blender::calculate_verts(), blender::tests::check_duplicates(), blender::geometry::construct::closer_v3_v3v3v3(), blender::ed::sculpt_paint::greasepencil::compute_auto_flip(), blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_points(), blender::io::fbx::ArmatureImportContext::create_armature_bones(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_projected(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_spherical(), blender::detail::distance_squared(), distance_squared(), blender::distfactor_to_bone(), blender::bke::pbvh::edge_queue_tri_in_circle(), blender::bke::pbvh::edge_queue_tri_in_sphere(), blender::ed::sculpt_paint::fake_neighbor_search_bmesh(), blender::ed::sculpt_paint::fake_neighbor_search_grids(), blender::ed::sculpt_paint::fake_neighbor_search_mesh(), blender::find_closest_point(), blender::ed::sculpt_paint::SlideOperationExecutor::find_closest_ray_hit(), blender::ed::sculpt_paint::find_curves_brush_position(), blender::ed::sculpt_paint::SlideOperationExecutor::find_curves_to_slide_with_symmetry(), blender::ed::sculpt_paint::CutOperationExecutor::find_projected_points_in_stroke(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_projected_smooth_factors(), blender::ed::sculpt_paint::CutOperationExecutor::find_spherical_points_in_stroke(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_spherical_smooth_factors(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_spherical(), blender::ed::sculpt_paint::geometry_preview_lines_update(), blender::ed::sculpt_paint::boundary::get_closest_boundary_vert_bmesh(), blender::ed::sculpt_paint::boundary::get_closest_boundary_vert_grids(), blender::ed::sculpt_paint::boundary::get_closest_boundary_vert_mesh(), blender::nodes::node_geo_sample_nearest_cc::get_closest_mesh_corners(), blender::nodes::node_geo_sample_nearest_cc::get_closest_mesh_edges(), blender::nodes::node_geo_sample_nearest_cc::get_closest_mesh_points(), blender::nodes::node_geo_sample_nearest_cc::get_closest_mesh_tris(), blender::nodes::node_geo_sample_nearest_cc::get_closest_pointcloud_points(), blender::get_space_input_chains(), blender::ed::greasepencil::grease_pencil_primitive_event_modal_map(), blender::ed::greasepencil::grease_pencil_primitive_mouse_event(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::intersections_segment_circle_integers(), blender::seq::jump_flooding_pass(), blender::layerEqual_propfloat2(), blender::nearest_tri_cb(), blender::ed::sculpt_paint::nearest_vert_calc_bmesh(), blender::ed::sculpt_paint::nearest_vert_calc_grids(), blender::ed::sculpt_paint::nearest_vert_calc_mesh(), blender::ed::sculpt_paint::node_in_sphere(), blender::bke::pbvh::node_raycast_bmesh(), blender::ed::sculpt_paint::greasepencil::VertexAverageOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexBlurOperation::on_stroke_extended(), blender::ed::sculpt_paint::paint_smooth_stroke(), blender::ed::curves::pen_tool::pen_find_closest_edge_point(), blender::ed::curves::pen_tool::pen_find_closest_handle(), blender::ed::curves::pen_tool::pen_find_closest_point(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_projected(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_spherical(), blender::ed::greasepencil::primitive_check_ui_hover(), blender::project_on_mesh(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::projected_snake_hook(), blender::bke::mesh_surface_sample::sample_nearest_corner(), blender::bke::mesh_surface_sample::sample_surface_points_spherical(), blender::ed::curves::select_circle_mask(), blender::shrinkwrap_calc_nearest_vertex_cb_ex(), blender::tests::TEST(), blender::tests::TEST(), blender::uv_remove_doubles_to_selected_shared_vertex(), blender::vfont_to_curve(), blender::view3d_ruler_pick(), and blender::math::QuaternionBase< T >::wrapped_around().

◆ divide_ceil()

template<typename T, int Size>
VecBase< T, Size > blender::math::divide_ceil ( const VecBase< T, Size > & a,
const VecBase< T, Size > & b )
inlinenodiscard

Integer division that returns the ceiling, instead of flooring like normal C division. It is undefined if a is negative or b is not strictly positive.

Definition at line 319 of file BLI_math_vector.hh.

References b, blender::BLI_assert(), divide_ceil(), and blender::result.

Referenced by blender::nodes::node_composite_displace_cc::DisplaceOperation::compute_anisotropic(), blender::compositor::compute_complete_blocks(), blender::compositor::compute_complete_x_prologues(), blender::compositor::compute_complete_y_prologues(), blender::compositor::compute_dispatch_threads_at_least(), blender::compositor::compute_incomplete_prologues(), blender::nodes::node_composite_vector_blur_cc::compute_max_tile_velocity_cpu(), blender::nodes::node_composite_vector_blur_cc::VectorBlurOperation::compute_max_tile_velocity_gpu(), divide_ceil(), blender::eevee::LightModule::end_sync(), blender::eevee::ShadowModule::end_sync(), blender::eevee::VolumeModule::end_sync(), blender::nodes::node_composite_map_uv_cc::MapUVOperation::execute_cpu_anisotropic(), blender::nodes::node_composite_glare_cc::GlareOperation::get_glare_image_domain(), blender::eevee::VolumeModule::init(), blender::compositor::parallel_reduction_dispatch(), blender::eevee::Precompute::Precompute(), blender::eevee::DepthOfField::render(), blender::eevee::MotionBlurModule::render(), blender::eevee::RayTraceModule::render(), blender::eevee::ShadowModule::render(), blender::eevee::SubsurfaceModule::render(), blender::eevee::LookdevModule::rotate_world_probe_data(), blender::ed::vse::sequencer_draw_scopes(), blender::eevee::VolumeProbeModule::set_view(), blender::eevee::LookdevModule::store_world_probe_data(), blender::eevee::IrradianceBake::surfels_create(), blender::eevee::AmbientOcclusion::sync(), blender::eevee::DepthOfField::sync(), blender::eevee::Film::sync(), blender::eevee::HiZBuffer::sync(), blender::tests::TEST(), and blender::eevee::Film::write_viewport_compositor_passes().

◆ dominant_axis()

◆ dot() [1/2]

template<typename T>
T blender::math::dot ( const QuaternionBase< T > & a,
const QuaternionBase< T > & b )
inlinenodiscard

Dot product between two quaternions. Equivalent to vector dot product. Equivalent to component wise multiplication followed by summation of the result.

Definition at line 199 of file BLI_math_quaternion.hh.

References b, dot(), T, blender::math::QuaternionBase< T >::w, blender::math::QuaternionBase< T >::x, blender::math::QuaternionBase< T >::y, and blender::math::QuaternionBase< T >::z.

Referenced by blender::bke::mesh::accumulate_fan_normal(), angle_between(), blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), blender::bmo_circularize_exec(), blender::bmo_flatten_exec(), blender::bke::build_point_matrix_miter_scale(), blender::ed::sculpt_paint::calc_area_normal_and_center_node_bmesh(), blender::ed::sculpt_paint::calc_area_normal_and_center_node_grids(), blender::ed::sculpt_paint::calc_area_normal_and_center_node_mesh(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_bmesh(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_grids(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_mesh(), blender::ed::sculpt_paint::calc_front_face(), blender::ed::sculpt_paint::calc_front_face(), blender::ed::sculpt_paint::calc_front_face(), blender::ed::sculpt_paint::calc_front_face(), blender::ed::sculpt_paint::calc_front_face(), blender::calc_min_radius_v3v3(), blender::ed::sculpt_paint::cloth::calc_perpendicular_pinch_forces(), blender::ed::sculpt_paint::calc_stabilized_plane(), blender::seq::calc_wipe_blend(), blender::ed::transform::calcEdgeSlide_mval_range(), blender::bke::curves::bezier::calculate_align_both_handles(), blender::ed::greasepencil::calculate_texture_space(), blender::xpbd::closest_on_segment_to_ray(), blender::compositor::closest_point_on_line(), closest_to_line_segment(), closest_to_plane_normalized(), blender::nodes::node_composite_color_correction_cc::color_correction(), blender::nodes::node_composite_rgb_to_bw_cc::color_to_luminance(), blender::noise::compute_2d_gabor_kernel(), blender::noise::compute_3d_gabor_kernel(), blender::ed::sculpt_paint::greasepencil::compute_auto_flip(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::compute_classic(), blender::nodes::node_composite_tone_map_cc::ToneMapOperation::compute_global_adaptation_level(), blender::bke::mesh::corner_fan_space_define(), blender::bke::mesh::corner_space_custom_normal_to_data(), cotangent_tri_weight(), blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_points(), blender::io::fbx::create_transform_curve_data(), blender::nodes::node_composite_difference_key_cc::difference_matte(), blender::nodes::node_composite_vector_blur_cc::dir_compare(), blender::distfactor_to_bone(), blender::ed::sculpt_paint::brushes::do_bmesh_topology_rake_brush(), blender::ed::sculpt_paint::brushes::do_multiplane_scrape_brush(), blender::ed::sculpt_paint::color::do_smear_brush_task(), dot(), dot(), blender::draw::edge_factor_calc(), blender::geometry::construct::edges_angle_kind(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic_cpu(), blender::execute_curve_chain(), blender::nodes::node_composite_lens_distortion_cc::LensDistortionOperation::execute_horizontal_distortion_cpu(), faceforward(), blender::geometry::fillet_handle_type(), blender::find_envelope(), blender::ed::sculpt_paint::CutOperationExecutor::find_spherical_cut_boundary(), blender::ed::greasepencil::generate_arc_from_point_to_point(), blender::ed::greasepencil::generate_corner(), blender::nodes::node_fn_compare_cc::get_multi_function(), blender::ed::sculpt_paint::greasepencil::get_screen_projection_fn(), blender::nodes::node_geo_input_mesh_edge_angle_cc::SignedAngleFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_mesh_face_is_planar_cc::PlanarFieldInput::get_varray_for_context(), blender::ed::greasepencil::grease_pencil_texture_gradient_exec(), blender::draw::overlay::FlatObjectRef::if_flat_axis_orthogonal_to_view(), blender::ed::sculpt_paint::face_set::init_op_exec(), blender::bke::pbvh::TriRasterizer::inside(), interpolate(), blender::ed::sculpt_paint::CutOperationExecutor::intersect_line_segment_sphere_2d(), blender::xpbd::intersect_plane(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::intersections_segment_circle_integers(), invert(), blender::ed::sculpt_paint::gesture::is_affected(), blender::nodes::node_composite_vector_blur_cc::is_inside_motion_line(), is_orthogonal(), blender::geometry::geom::is_outside_edge(), is_similarity_transform(), blender::isect_vert_calc_z(), length_squared(), line_point_factor(), blender::ed::curves::pen_tool::line_segment_closest_point(), blender::nodes::node_composite_luminance_key_cc::luminance_matte(), blender::bke::mesh::mesh_edges_sharp_tag(), blender::geometry::profile::move_profile_plane(), blender::geometry::profile::move_weld_profile_planes(), blender::geometry::construct::nearly_parallel_normalized(), blender::geometry::construct::next_edgehalf_bev(), blender::ed::sculpt_paint::node_in_box(), blender::ed::sculpt_paint::auto_mask::normal_calc(), normalize(), normalize_and_get_length(), blender::ed::sculpt_paint::expand::normals_falloff_create(), blender::ed::transform::object_project_all_view3d_ex(), blender::ed::transform::occlusion_plane_create(), blender::geometry::geom::offset_meet(), blender::math::DualQuaternionBase< T >::operator+=(), orthogonalize(), blender::geometry::perpendicular_distance(), blender::geometry::construct::pipe_test(), plane_from_point_normal(), blender::geometry::geom::point_between_edges(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), project(), blender::project_chain_to_2d(), blender::ed::sculpt_paint::project_translations(), blender::nodes::node_composite_lens_distortion_cc::radial_lens_distortion(), blender::io::spz::read_rotations(), reflect(), blender::eevee::PlanarProbe::reflection_clip_plane_get(), refract(), blender::fn::multi_function::register_common_functions_impl(), blender::io::grease_pencil::GreasePencilExporter::retrieve_objects(), rotate_direction_around_axis(), blender::ed::sculpt_paint::AddOperationExecutor::sample_spherical(), blender::bke::mesh_surface_sample::sample_surface_points_projected(), blender::scopes_update_cb(), blender::nodes::node_composite_levels_cc::LevelsOperation::set_output(), blender::ed::mesh::set_sharpness_by_angle_exec(), blender::compositor::SMAALumaEdgeDetectionPS(), blender::compositor::SMAANeighborhoodBlendingPS(), blender::compositor::SMAASearchDiag1(), blender::compositor::SMAASearchDiag2(), blender::ed::transform::snap_object_project_view3d_ex(), blender::geometry::curve_constraints::solve_length_and_collision_constraints(), blender::xpbd::CollisionEdgeConstraintSet::solve_single(), blender::xpbd::CollisionFaceConstraintSet::solve_single(), blender::xpbd::FrictionEdgeConstraintSet::solve_single(), blender::xpbd::FrictionFaceConstraintSet::solve_single(), blender::math::tests::TEST(), blender::ed::transform::transform_mesh_edge_slide_data_create(), blender::ed::transform::transform_mesh_uv_edge_slide_data_create(), blender::ed::greasepencil::boolean::transform_plane(), blender::eevee::ForwardPipeline::transparent_add(), blender::geometry::construct::tri_corner_test(), blender::ed::transform::VertSlideData::update_active_edges(), blender::v3_dist_from_plane(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_distance_to_edge(), whitepoint_to_temp_tint(), blender::wm_xr_navigation_teleport_arc_scene_intersect(), and blender::wm_xr_navigation_teleport_is_wall_hit().

◆ dot() [2/2]

template<typename T, int Size>
T blender::math::dot ( const VecBase< T, Size > & a,
const VecBase< T, Size > & b )
inlinenodiscard

Dot product between two vectors. Equivalent to component wise multiplication followed by summation of the result. Equivalent to the cosine of the angle between the two vectors if the vectors are normalized.

Note
prefer using length_manhattan(a) than dot(a, vec(1)) to get the sum of all components.

Definition at line 431 of file BLI_math_vector.hh.

References b, dot(), blender::result, and T.

◆ exp() [1/2]

◆ exp() [2/2]

template<typename T, int Size>
VecBase< T, Size > blender::math::exp ( const VecBase< T, Size > & x)
inlinenodiscard

Definition at line 285 of file BLI_math_vector.hh.

References BLI_UNROLL_MATH_VEC_OP_VEC, exp(), and blender::x.

◆ faceforward()

template<typename T, int Size>
VecBase< T, Size > blender::math::faceforward ( const VecBase< T, Size > & vector,
const VecBase< T, Size > & incident,
const VecBase< T, Size > & reference )
inlinenodiscard

Return vector if incident and reference are pointing in the same direction.

Definition at line 658 of file BLI_math_vector.hh.

References dot(), and faceforward().

Referenced by faceforward(), and blender::fn::multi_function::register_common_functions_impl().

◆ fallback_pow() [1/2]

template<typename T>
T blender::math::fallback_pow ( const T & x,
const T & power,
const T & fallback )
inline

◆ fallback_pow() [2/2]

template<typename T, int Size>
VecBase< T, Size > blender::math::fallback_pow ( const VecBase< T, Size > & x,
const T & y,
const VecBase< T, Size > & fallback )
inlinenodiscard

Return the value of x raised to the y power. The result is the given fallback if x < 0 or if x = 0 and y <= 0.

Definition at line 256 of file BLI_math_vector.hh.

References fallback_pow(), blender::result, T, blender::x, and y.

◆ filt_catrom()

float blender::math::filt_catrom ( float x)
static

Definition at line 48 of file math_filter.cc.

References filt_catrom(), and blender::x.

Referenced by filt_catrom(), and filter_kernel_value().

◆ filt_cubic()

float blender::math::filt_cubic ( float x)
static

Definition at line 31 of file math_filter.cc.

References filt_cubic(), and blender::x.

Referenced by filt_cubic(), and filter_kernel_value().

◆ filt_mitchell()

float blender::math::filt_mitchell ( float x)
static

Definition at line 64 of file math_filter.cc.

References b, filt_mitchell(), and blender::x.

Referenced by filt_mitchell(), and filter_kernel_value().

◆ filt_quadratic()

float blender::math::filt_quadratic ( float x)
static

Definition at line 17 of file math_filter.cc.

References filt_quadratic(), and blender::x.

Referenced by filt_quadratic(), and filter_kernel_value().

◆ filter_kernel_value()

◆ float_to_half()

uint16_t blender::math::float_to_half ( float v)

Float (FP32) <-> Half (FP16) conversion functions.

Behavior matches hardware (x64 F16C, ARM NEON FCVT), including handling of denormals, infinities, NaNs, rounding is to nearest even, etc. When NaNs are produced, the exact bit pattern might not match hardware, but it will still be a NaN.

When compiling for ARM NEON (e.g. Apple Silicon), hardware VCVT instructions are used.

For anything involving more than a handful of numbers, prefer float_to_half_array and half_to_float_array for performance. Converts float (FP32) number to half-precision (FP16).

Definition at line 32 of file math_half.cc.

References sign(), and blender::v.

Referenced by blender::gpu::convert(), blender::convert_input_to_half_rgba(), float_to_half_array(), float_to_half_clamp_array(), and float_to_half_make_finite().

◆ float_to_half_array()

void blender::math::float_to_half_array ( const float * src,
uint16_t * dst,
size_t length )

Definition at line 256 of file math_half.cc.

References float_to_half(), and length().

Referenced by blender::tests::TEST().

◆ float_to_half_clamp_array()

void blender::math::float_to_half_clamp_array ( const float * src,
uint16_t * dst,
size_t length,
float min_value,
float max_value )

◆ float_to_half_make_finite()

uint16_t blender::math::float_to_half_make_finite ( float v)

Converts float (FP32) number to half-precision (FP16), also ensuring the result is finite.

Changes +/- infinities to +/- maximum value (65504), and NaNs to zeroes.

Definition at line 96 of file math_half.cc.

References float_to_half(), and blender::v.

Referenced by float_to_half_make_finite_array().

◆ float_to_half_make_finite_array()

void blender::math::float_to_half_make_finite_array ( const float * src,
uint16_t * dst,
size_t length )

◆ floor() [1/2]

template<typename T>
T blender::math::floor ( const T & a)
inline

Definition at line 112 of file BLI_math_base.hh.

References floor(), and T.

Referenced by bicubic_interpolation(), blender::nodes::node_shader_map_range_cc::build_vector_stepped(), blender::calculate_repetitions(), blender::noise::compute_2d_gabor_noise(), blender::noise::compute_3d_gabor_noise(), blender::ed::sculpt_paint::greasepencil::ColorGrid::coords_to_pos(), blender::deform_drawing(), blender::deform_drawing(), blender::bke::pbvh::pixels::do_encode_pixels(), blender::geometry::extend_curve_straight(), blender::seq::final_image_cache_invalidate_frame_range(), floor(), floor(), blender::noise::floor_fraction(), blender::floored_modulo(), blender::ed::greasepencil::grease_pencil_snap_to_grid_exec(), blender::TimeMapping::local_frame_before_scene_frame(), mod_periodic(), blender::nodes::node_composite_posterize_cc::posterize(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), blender::compositor::Domain::realize_transformation(), blender::fn::multi_function::register_common_functions_impl(), blender::geometry::sample_curve_attribute(), blender::TimeMapping::scene_frame_before_local_frame(), blender::table_sample(), blender::bke::pbvh::TriRasterizer::TriRasterizer(), blender::eevee::Film::update_sample_table(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_f1(), blender::noise::voronoi_f1(), blender::noise::voronoi_f1(), blender::noise::voronoi_f2(), blender::noise::voronoi_f2(), blender::noise::voronoi_f2(), blender::noise::voronoi_n_sphere_radius(), blender::noise::voronoi_n_sphere_radius(), blender::noise::voronoi_n_sphere_radius(), blender::noise::voronoi_smooth_f1(), blender::noise::voronoi_smooth_f1(), blender::noise::voronoi_smooth_f1(), and wrap_coord().

◆ floor() [2/2]

template<typename T, int Size>
VecBase< T, Size > blender::math::floor ( const VecBase< T, Size > & a)
inlinenodiscard

Definition at line 358 of file BLI_math_vector.hh.

References BLI_UNROLL_MATH_VEC_OP_VEC, and floor().

◆ floored_mod() [1/3]

template<typename T>
T blender::math::floored_mod ( const T & a,
const T & b )
inline

Definition at line 89 of file BLI_math_base.hh.

References b, floored_mod(), and T.

Referenced by floored_mod(), floored_mod(), and floored_mod().

◆ floored_mod() [2/3]

template<typename T, int Size>
VecBase< T, Size > blender::math::floored_mod ( const VecBase< T, Size > & a,
const T & b )
inlinenodiscard

Definition at line 213 of file BLI_math_vector.hh.

References b, blender::BLI_assert(), floored_mod(), blender::result, and T.

◆ floored_mod() [3/3]

template<typename T, int Size>
VecBase< T, Size > blender::math::floored_mod ( const VecBase< T, Size > & a,
const VecBase< T, Size > & b )
inlinenodiscard

Definition at line 201 of file BLI_math_vector.hh.

References b, blender::BLI_assert(), floored_mod(), and blender::result.

◆ fract() [1/2]

◆ fract() [2/2]

template<typename T, int Size>
VecBase< T, Size > blender::math::fract ( const VecBase< T, Size > & a)
inlinenodiscard

Definition at line 419 of file BLI_math_vector.hh.

References BLI_UNROLL_MATH_VEC_OP_VEC, and fract().

◆ from_direction()

template<typename T>
MatBase< T, 2, 2 > blender::math::from_direction ( const VecBase< T, 2 > & direction)
nodiscard

Create a rotation matrix with the angle that the given direction makes with the x axis. Assumes the direction vector is normalized.

Definition at line 1483 of file BLI_math_matrix.hh.

References blender::BLI_assert(), from_direction(), is_unit_scale(), and blender::MatBase< T, NumCol, NumRow, Alignment >::MatBase().

Referenced by blender::nodes::node_composite_chroma_key_cc::chroma_matte(), from_direction(), and rotate().

◆ from_loc_rot()

template<typename MatT, typename RotationT>
MatT blender::math::from_loc_rot ( const typename MatT::loc_type & location,
const RotationT & rotation )
nodiscard

Create a transform matrix with translation and rotation applied in this order.

Definition at line 1465 of file BLI_math_matrix.hh.

References from_loc_rot(), and from_rotation().

Referenced by from_loc_rot(), blender::draw::overlay::Axes::object_sync(), rotate(), and blender::math::tests::TEST().

◆ from_loc_rot_scale()

template<typename MatT, typename RotationT, int ScaleDim>
MatT blender::math::from_loc_rot_scale ( const typename MatT::loc_type & location,
const RotationT & rotation,
const VecBase< typename MatT::base_type, ScaleDim > & scale )
nodiscard

◆ from_loc_scale()

template<typename MatT, int ScaleDim>
MatT blender::math::from_loc_scale ( const typename MatT::loc_type & location,
const VecBase< typename MatT::base_type, ScaleDim > & scale )
nodiscard

◆ from_location()

◆ from_origin_transform()

template<typename MatT, typename VectorT>
MatT blender::math::from_origin_transform ( const MatT & transform,
const VectorT origin )
nodiscard

Construct a transformation that is pivoted around the given origin point. So for instance, from_origin_transform<MatT>(from_rotation(std::numbers::pi * 0.5), float2(0.0f, 2.0f)) will construct a transformation representing a 90 degree rotation around the point (0, 2).

Definition at line 1629 of file BLI_math_matrix.hh.

References from_location(), and from_origin_transform().

Referenced by blender::seq::calc_strip_transform_matrix(), from_origin_transform(), blender::seq::image_transform_matrix_get(), and rotate().

◆ from_orthonormal_axes() [1/3]

CartesianBasis blender::math::from_orthonormal_axes ( const AxisSigned forward,
const AxisSigned up )
inlinenodiscard

Create an CartesianBasis using two orthogonal axes. The third axis is chosen by right hand rule to follow blender coordinate system. forward is Y axis in blender coordinate system. up is Z axis in blender coordinate system.

Note
forward and up must be different axes.

Definition at line 405 of file BLI_math_basis_types.hh.

References abs(), blender::BLI_assert(), cross(), and from_orthonormal_axes().

Referenced by from_orthonormal_axes(), from_orthonormal_axes(), from_orthonormal_axes(), from_tracking(), blender::eevee::IrradianceBake::raylists_build(), rotate(), rotation_between(), blender::math::tests::TEST(), blender::math::tests::TEST(), and blender::math::tests::TEST().

◆ from_orthonormal_axes() [2/3]

template<typename MatT, typename VectorT>
MatT blender::math::from_orthonormal_axes ( const VectorT forward,
const VectorT up )
nodiscard

Create a rotation matrix from 2 basis vectors. The matrix determinant is given to be positive and it can be converted to other rotation types.

Note
forward and up must be normalized.

Definition at line 1491 of file BLI_math_matrix.hh.

References blender::BLI_assert(), cross(), from_orthonormal_axes(), and is_unit_scale().

◆ from_orthonormal_axes() [3/3]

template<typename MatT, typename VectorT>
MatT blender::math::from_orthonormal_axes ( const VectorT location,
const VectorT forward,
const VectorT up )
nodiscard

Create a transform matrix with translation and rotation from 2 basis vectors and a translation.

Note
forward and up must be normalized.

Definition at line 1507 of file BLI_math_matrix.hh.

References from_orthonormal_axes().

◆ from_rot_scale()

template<typename MatT, typename RotationT, typename VectorT>
MatT blender::math::from_rot_scale ( const RotationT & rotation,
const VectorT & scale )
nodiscard

Create a transform matrix with rotation and scale applied in this order.

Definition at line 1447 of file BLI_math_matrix.hh.

References from_rot_scale(), from_rotation(), from_scale(), and scale().

Referenced by from_loc_rot_scale(), from_rot_scale(), interpolate_fast(), and rotate().

◆ from_rotation()

template<typename MatT, typename RotationT>
MatT blender::math::from_rotation ( const RotationT & rotation)
nodiscard

Create a rotation only matrix.

Definition at line 1441 of file BLI_math_matrix.hh.

References blender::math::detail::from_rotation(), and from_rotation().

Referenced by blender::draw::overlay::Cursor::begin_sync(), blender::BKE_camera_viewplane_offset_transform(), blender::nodes::node_fn_combine_transform_cc::CombineTransformFunction::call(), blender::io::usd::convert_to_z_up(), blender::ed::sculpt_paint::cursor_space_drawing_setup(), blender::io::alembic::ABCTransformWriter::do_write(), blender::drw_render_border_mask(), blender::ED_view3d_camera_view_pan(), blender::nodes::node_composite_rotate_cc::RotateOperation::execute(), blender::geometry::extend_curve_curved(), from_loc_rot(), from_rot_scale(), from_rotation(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::get_delta_translation(), blender::ed::greasepencil::grease_pencil_texture_gradient_exec(), interpolate(), blender::ed::view3d::geometry_nodes_gizmos::matrix_from_position_and_up_direction(), blender::bke::quaternion_to_float4x4(), blender::io::grease_pencil::SVGImporter::read(), rotate(), rotate(), rotate(), rotate(), rotate_around_point_2d(), blender::eevee::LookdevModule::rotate_world(), blender::math::tests::TEST(), blender::TEST(), to_dual_quaternion(), to_euler(), to_euler(), to_gimbal_axis(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_rotate_transform_and_target_property(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_scale_transform_and_target_property(), and blender::view_zoom_to_window_xy_camera().

◆ from_scale()

template<typename MatT, int ScaleDim>
MatT blender::math::from_scale ( const VecBase< typename MatT::base_type, ScaleDim > & scale)
nodiscard

Create a matrix whose diagonal is defined by the given scale vector. If vector dimension is lower than matrix diagonal, the missing terms are filled with ones.

Definition at line 1430 of file BLI_math_matrix.hh.

References blender::BLI_STATIC_ASSERT(), from_scale(), blender::result, scale(), and unroll.

Referenced by blender::draw::overlay::Cursor::begin_sync(), blender::ed::sculpt_paint::brushes::clay_strips::calc_local_matrix(), blender::seq::calc_strip_transform_matrix(), blender::nodes::node_fn_combine_transform_cc::CombineTransformFunction::call(), chromatic_adaption_matrix(), blender::image_engine::Instance::compute_screen_space_to_sampler_space_transformation(), blender::nodes::node_geo_string_to_curves_cc::create_curve_instances(), blender::ed::sculpt_paint::cube_tip_init(), blender::ed::sculpt_paint::brushes::do_clay_thumb_brush(), blender::ed::sculpt_paint::brushes::do_plane_brush(), blender::io::usd::USDTransformWriter::do_write(), blender::drw_shgroup_bone_custom_empty(), blender::draw::drw_volume_object_mesh_init(), blender::compositor::RealizeOnDomainOperation::execute(), blender::nodes::node_composite_scale_cc::ScaleOperation::execute_constant_size(), from_loc_scale(), from_rot_scale(), blender::math::detail::from_rotation(), from_scale(), blender::bke::greasepencil::convert::get_legacy_stroke_to_texture_matrix(), blender::get_mirror_matrix(), blender::ed::greasepencil::grease_pencil_texture_gradient_exec(), blender::seq::image_transform_matrix_get(), blender::nodes::node_geo_rasterize_points::node_geo_exec(), blender::draw::overlay::Bounds::object_sync(), polar_decompose(), pseudo_invert(), blender::io::usd::USDXformReader::read_matrix(), rotate(), blender::eevee::VolumeProbeModule::set_view(), blender::draw::test_draw_manager_sync(), blender::draw::test_draw_resource_id_gen(), blender::draw::test_draw_visibility(), blender::imbuf::tests::transform_2x_smaller(), blender::imbuf::tests::transform_fractional_larger(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_scale_transform_and_target_property(), and blender::ed::view3d::geometry_nodes_gizmos::DialGizmo::update_transform().

◆ from_tracking()

template<typename T>
QuaternionBase< T > blender::math::from_tracking ( AxisSigned forward_axis,
Axis up_axis )
nodiscard

Returns a quaternion for converting local space to tracking space. This is slightly different than from_axis_conversion for legacy reasons.

Definition at line 358 of file BLI_math_rotation.hh.

References blender::math::AxisSigned::axis(), blender::math::AxisSigned::AxisSigned(), blender::BLI_assert(), from_orthonormal_axes(), from_tracking(), blender::math::QuaternionBase< T >::QuaternionBase(), rotation_between(), blender::math::AxisSigned::Y_POS, and blender::math::AxisSigned::Z_POS.

Referenced by from_tracking().

◆ from_triangle() [1/2]

template<typename T>
QuaternionBase< T > blender::math::from_triangle ( const VecBase< T, 3 > & v1,
const VecBase< T, 3 > & v2,
const VecBase< T, 3 > & v3 )
nodiscard

Create a orientation from a triangle plane and the axis formed by the segment(v1, v2).

Definition at line 268 of file BLI_math_rotation.hh.

References from_triangle(), normal_tri(), and blender::v2.

◆ from_triangle() [2/2]

template<typename T>
QuaternionBase< T > blender::math::from_triangle ( const VecBase< T, 3 > & v1,
const VecBase< T, 3 > & v2,
const VecBase< T, 3 > & v3,
const VecBase< T, 3 > & normal )
nodiscard

Create a orientation from a triangle plane and the axis formed by the segment(v1, v2). Takes pre-computed normal from the triangle. Used for Ngons when their normal is known.

Definition at line 234 of file BLI_math_rotation.hh.

References angle(), atan2(), conjugate(), cos(), from_triangle(), is_zero(), normalize(), safe_acos(), sin(), T, transform_point(), UNUSED_VARS, and blender::v2.

Referenced by from_triangle(), from_triangle(), and blender::math::tests::TEST().

◆ from_up_axis()

template<typename MatT, typename VectorT>
MatT blender::math::from_up_axis ( const VectorT up)
nodiscard

Create a rotation matrix from only one up axis. The other axes are chosen to always be orthogonal. The resulting matrix is a basis matrix.

Note
up must be normalized.
This can be used to create a tangent basis from a normal vector.
The output of this function is not given to be same across blender version. Prefer using from_orthonormal_axes for more stable output.

Definition at line 1517 of file BLI_math_matrix.hh.

References b, blender::BLI_assert(), from_up_axis(), is_unit_scale(), sign(), square(), T, blender::MatBase< T, NumCol, NumRow, Alignment >::x_axis(), blender::MatBase< T, NumCol, NumRow, Alignment >::y_axis(), and blender::MatBase< T, NumCol, NumRow, Alignment >::z_axis().

Referenced by blender::bm_vert_chain_orientation_matrix_calc(), from_up_axis(), and rotate().

◆ from_vector()

template<typename T>
QuaternionBase< T > blender::math::from_vector ( const VecBase< T, 3 > & vector,
const AxisSigned track_flag,
const Axis up_flag )
nodiscard

◆ half_to_float()

float blender::math::half_to_float ( uint16_t v)

Converts half-precision (FP16) number to float (FP32).

Definition at line 113 of file math_half.cc.

References exp(), and blender::v.

Referenced by blender::gpu::convert(), blender::gpu::convert(), half_to_float_array(), blender::ViewportColorSampleSession::sample(), and blender::tests::TEST().

◆ half_to_float_array()

void blender::math::half_to_float_array ( const uint16_t * src,
float * dst,
size_t length )

◆ hypot()

template<typename T>
T blender::math::hypot ( const T & y,
const T & x )
inline

◆ interp_bilinear_quad()

template<typename T>
VecBase< T, 3 > blender::math::interp_bilinear_quad ( const VecBase< T, 3 > & v0,
const VecBase< T, 3 > & v1,
const VecBase< T, 3 > & v2,
const VecBase< T, 3 > & v3,
const T u,
const T v )
inlinenodiscard

Bilinear interpolation of four 3D points at parameter (u, v).

The four vertices are ordered as a bilinear patch:

v=1 v3---v2
| |
v=0 v0---v1
u=0 u=1
Parameters
v0,v1,v2,v3The four corner points.
uInterpolation parameter in the first direction (0..1).
vInterpolation parameter in the second direction (0..1).
Returns
The interpolated point.

Definition at line 438 of file BLI_math_geom.hh.

References interp_bilinear_quad(), T, blender::v, and blender::v2.

Referenced by interp_bilinear_quad(), and TEST().

◆ interp_weights_poly()

void blender::math::interp_weights_poly ( MutableSpan< float > r_weights,
Span< float2 > verts,
const float2 & co )
inline

Compute mean-value interpolation weights for point co inside the 2D polygon defined by verts. Writes one weight per vertex into r_weights.

Parameters
r_weightsOutput weights, must have the same size as verts.
vertsPolygon vertices, in order.
coThe query point.

Definition at line 403 of file BLI_math_geom.hh.

References blender::BLI_assert(), blender::MutableSpan< T >::data(), blender::Span< T >::data(), interp_weights_poly(), blender::interp_weights_poly_v2(), blender::MutableSpan< T >::size(), and blender::Span< T >::size().

Referenced by blender::geometry::construct::compute_face_interp_weights(), interp_weights_poly(), and TEST().

◆ interpolate() [1/11]

◆ interpolate() [2/11]

◆ interpolate() [3/11]

template double3x3 blender::math::interpolate ( const double3x3 & a,
const double3x3 & b,
double t )

References b, and interpolate().

◆ interpolate() [4/11]

template double4x4 blender::math::interpolate ( const double4x4 & a,
const double4x4 & b,
double t )

References b, and interpolate().

◆ interpolate() [5/11]

template float3x3 blender::math::interpolate ( const float3x3 & a,
const float3x3 & b,
float t )

References b, and interpolate().

◆ interpolate() [6/11]

template float4x4 blender::math::interpolate ( const float4x4 & a,
const float4x4 & b,
float t )

References b, and interpolate().

◆ interpolate() [7/11]

template<typename T>
MatBase< T, 3, 3 > blender::math::interpolate ( const MatBase< T, 3, 3 > & a,
const MatBase< T, 3, 3 > & b,
T t )
nodiscard

A polar-decomposition-based interpolation between matrix A and matrix B.

Note
This code is about five times slower than the 'naive' interpolation (it typically remains below 2 usec on an average i74700, while naive implementation remains below 0.4 usec). However, it gives expected results even with non-uniformly scaled matrices, see #46418 for an example.

Based on "Matrix Animation and Polar Decomposition", by Ken Shoemake & Tom Duff

Parameters
aInput matrix which is totally effective with t = 0.0.
bInput matrix which is totally effective with t = 1.0.
tInterpolation factor.

Definition at line 336 of file math_matrix.cc.

References A, B, from_rotation(), interpolate(), interpolate_linear(), is_negative(), normalize(), P, polar_decompose(), T, to_quaternion(), and blender::U.

◆ interpolate() [8/11]

template<typename T>
MatBase< T, 4, 4 > blender::math::interpolate ( const MatBase< T, 4, 4 > & a,
const MatBase< T, 4, 4 > & b,
T t )
nodiscard

Complete transform matrix interpolation, based on polar-decomposition-based interpolation from interpolate<T, 3, 3>.

Parameters
aInput matrix which is totally effective with t = 0.0.
bInput matrix which is totally effective with t = 1.0.
tInterpolation factor.

Definition at line 380 of file math_matrix.cc.

References A, B, interpolate(), blender::result, and T.

◆ interpolate() [9/11]

template<typename T>
QuaternionBase< T > blender::math::interpolate ( const QuaternionBase< T > & a,
const QuaternionBase< T > & b,
T t )
inlinenodiscard

Use spherical interpolation between two quaternions. Always interpolate along the shortest angle.

Definition at line 304 of file BLI_math_quaternion.hh.

References b, blender::BLI_assert(), dot(), interpolate(), invert_normalized(), is_unit_scale(), pow(), and T.

◆ interpolate() [10/11]

template<typename T, typename FactorT>
T blender::math::interpolate ( const T & a,
const T & b,
const FactorT & t )
inline

Definition at line 279 of file BLI_math_base.hh.

References b, interpolate(), blender::result, and T.

Referenced by blender::ed::greasepencil::add_armature_automatic_weights(), blender::nodes::node_composite_alpha_over_cc::alpha_over(), blender::nodes::node_composite_alpha_over_cc::alpha_over_conjoint(), blender::nodes::node_composite_alpha_over_cc::alpha_over_disjoint(), blender::apply_gradient_tint(), blender::seq::MaskSamplerDirectByte::apply_mask(), blender::seq::MaskSamplerDirectFloat::apply_mask(), blender::seq::MaskSamplerTransformedByte::apply_mask(), blender::seq::MaskSamplerTransformedFloat::apply_mask(), blender::apply_uniform_tint(), blender::ed::sculpt_paint::greasepencil::WeightPaintOperation::apply_weight_to_point(), blender::bke::armature_vert_task_with_mixer(), blender::draw::overlay::Grid::begin_sync(), blender::BKE_paint_randomize_color(), blender::animrig::blend_layer_results(), blender::bmo_flatten_exec(), blender::bmo_space_edge_loops_evenly_exec(), blender::compositor::bokeh(), blender::calc_min_radius_v3v3(), blender::geometry::calc_position_with_interpolation(), blender::geometry::calc_radius_with_interpolation(), blender::ed::sculpt_paint::calc_stabilized_plane(), blender::ed::space_node::calculate_inner_link_bezier_points(), blender::geometry::profile::calculate_profile_segments(), blender::bke::curves::bezier::calculate_vector_handle(), blender::calculate_verts(), blender::ed::greasepencil::trim::check_segments_in_lasso(), blender::nodes::node_composite_color_balance_cc::color_balance(), blender::nodes::node_composite_color_correction_cc::color_correction(), blender::io::grease_pencil::GreasePencilExporter::compute_average_stroke_color(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_fog_glow_field_of_view(), blender::nodes::node_composite_tone_map_cc::ToneMapOperation::compute_global_adaptation_level(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::compute_inpainting_region_cpu(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_matte_cpu(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::compute_piecewise_linear_falloff(), blender::ed::greasepencil::control_point_colors_and_sizes(), blender::bke::pbvh::pixels::copy_pixels(), blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_points(), blender::geometry::create_nurbs_to_bezier_positions(), blender::nodes::node_geo_curve_primitive_circle_cc::create_point_circle_curve(), blender::nodes::node_geo_curve_primitive_quadratic_bezier_cc::create_quadratic_bezier_curve(), blender::nodes::node_composite_rgb_curves_cc::curves_rgba(), blender::deform_drawing(), blender::deform_drawing(), blender::deform_drawing_as_envelope(), blender::distfactor_to_bone(), blender::ed::sculpt_paint::brushes::do_multiplane_scrape_brush(), blender::draw::gpencil::Instance::draw(), blender::DRW_text_edit_mesh_measure_stats(), blender::ed::transform::ElementResize(), blender::nodes::node_composite_despeckle_cc::DespeckleOperation::execute_cpu(), blender::nodes::node_composite_filter_cc::FilterOperation::execute_cpu(), blender::execute_curve_chain(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_anti_diagonal_pass_cpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_diagonal_pass_cpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_vertical_pass_cpu(), blender::nodes::node_composite_depth_combin_cc::ZCombineOperation::execute_single_value(), blender::geometry::extend_curve_straight(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::fill_inpainting_region_cpu(), blender::ed::space_node::find_bounds_by_zone_recursive(), blender::ed::sculpt_paint::find_curves_brush_position(), blender::find_envelope(), blender::find_plane_intersection(), blender::ed::space_node::find_visible_center_of_link(), blender::io::grease_pencil::GreasePencilExporter::foreach_shape_in_layer(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_projected(), blender::nodes::node_sh_mix_cc::get_multi_function(), blender::nodes::node_composite_keying_screen_cc::KeyingScreenOperation::get_smoothness(), blender::nodes::node_geo_input_cluster_by_connected_cc::ClusterByConnectedFieldInput::get_varray_for_context(), blender::gizmo_ruler_invoke(), blender::ed::sculpt_paint::grease_pencil_fill_extension_cut(), blender::ed::greasepencil::grease_pencil_vertex_paint_set_exec(), blender::nodes::node_composite_hue_correct_cc::hue_correct(), blender::nodes::node_composite_hue_saturation_value_cc::hue_saturation_value(), blender::bke::curves::bezier::insert(), blender::ed::curves::pen_tool::insert_point_to_curve(), interpolate(), interpolate(), interpolate(), interpolate(), interpolate(), interpolate(), interpolate(), interpolate(), interpolate(), interpolate(), interpolate(), interpolate_fast(), interpolate_fast(), interpolate_linear(), blender::ed::sculpt_paint::greasepencil::PaintOperation::interpolate_stroke_depth(), blender::length_parameterize::interpolate_to_masked(), blender::xpbd::intersect_plane(), blender::nodes::node_composite_invert_cc::invert(), blender::layerCopyValue_propfloat2(), blender::ed::greasepencil::boolean::LR_states_from_segment(), blender::bke::subdiv::mesh_interpolate_position_on_edge(), blender::bke::mesh_normals_varray(), blender::bke::attribute_math::mix2(), blender::bke::attribute_math::mix2(), blender::bke::attribute_math::mix2(), blender::bke::attribute_math::mix2(), blender::bke::attribute_math::mix2(), blender::bke::attribute_math::mix2(), blender::bke::attribute_math::mix2(), blender::bke::attribute_math::mix2(), blender::bke::attribute_math::mix2(), blender::geometry::mix_arrays(), blender::bke::subdiv::mix_normals(), blender::compositor::morphological_distance_feather_pass(), blender::ed::sculpt_paint::greasepencil::VertexAverageOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexBlurOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexSmearOperation::on_stroke_extended(), blender::ed::sculpt_paint::paint_smooth_stroke(), blender::geometry::perpendicular_distance(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_projected(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_spherical(), blender::geometry::construct::pipe_adj_vmesh(), blender::ed::greasepencil::primitive_calculate_curve_positions(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), blender::ed::sculpt_paint::PuffOperationExecutor::puff(), blender::ed::greasepencil::randomize_opacity(), blender::ed::greasepencil::randomize_radius(), blender::ed::greasepencil::randomize_rotation(), blender::ed::greasepencil::randomize_rotation(), rotate(), blender::bke::bSoundFrequencySampler::sample(), blender::geometry::sample_poly_curve_positions_handles(), blender::ed::sculpt_paint::color::sculpt_color_presmooth_init(), blender::ed::vse::sequencer_draw_scopes(), blender::ed::sculpt_paint::greasepencil::simplify_opacities(), blender::compositor::SMAAMovc(), blender::compositor::SMAAMovc(), blender::ed::sculpt_paint::SmoothOperationExecutor::smooth(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::xpbd::CollisionEdgeConstraintSet::solve_single(), blender::xpbd::FrictionEdgeConstraintSet::solve_single(), blender::geometry::construct::square_out_adj_vmesh(), blender::table_sample(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::io::otio::value_at(), blender::nodes::node_composite_color_balance_cc::white_point_constant(), whitepoint_from_temp_tint(), whitepoint_to_temp_tint(), blender::WM_gesture_lasso_modal(), blender::wm_xr_navigation_teleport_arc_clip_to_ground(), and blender::zspan_rasterize_conservative_line().

◆ interpolate() [11/11]

template<typename T, typename FactorT, int Size>
VecBase< T, Size > blender::math::interpolate ( const VecBase< T, Size > & a,
const VecBase< T, Size > & b,
const FactorT & t )
inlinenodiscard

Per component linear interpolation.

Parameters
tinterpolation factor. Return a if equal 0. Return b if equal 1. Outside of [0..1] range, use linear extrapolation.

Definition at line 637 of file BLI_math_vector.hh.

References b, and interpolate().

◆ interpolate_bilinear_border_byte()

uchar4 blender::math::interpolate_bilinear_border_byte ( const uchar * buffer,
int width,
int height,
float u,
float v )
nodiscard

Bilinear sampling (with black border).

Takes four image samples at floor(u,v) and floor(u,v)+1, and blends them based on fractional parts of u,v. Samples outside the image are turned into transparent black.

Note that you probably want to subtract 0.5 from u,v before this function, to get proper filtering.

Definition at line 368 of file math_interp.cc.

References bilinear_byte_impl(), interpolate_bilinear_border_byte(), and blender::v.

Referenced by blender::seq::MaskSamplerTransformedByte::apply_mask(), blender::imbuf::interpolate_bilinear_border_byte(), blender::imbuf::interpolate_bilinear_border_byte(), interpolate_bilinear_border_byte(), and blender::seq::MaskSamplerTransformedByte::load_mask_min().

◆ interpolate_bilinear_border_fl() [1/2]

void blender::math::interpolate_bilinear_border_fl ( const float * buffer,
float * output,
int width,
int height,
int components,
float u,
float v )

◆ interpolate_bilinear_border_fl() [2/2]

◆ interpolate_bilinear_byte()

uchar4 blender::math::interpolate_bilinear_byte ( const uchar * buffer,
int width,
int height,
float u,
float v )
nodiscard

Bilinear sampling.

Takes four image samples at floor(u,v) and floor(u,v)+1, and blends them based on fractional parts of u,v. Samples outside the image are clamped to texels at image edge.

Note that you probably want to subtract 0.5 from u,v before this function, to get proper filtering.

Definition at line 374 of file math_interp.cc.

References bilinear_byte_impl(), interpolate_bilinear_byte(), and blender::v.

Referenced by blender::imbuf::interpolate_bilinear_byte(), blender::imbuf::interpolate_bilinear_byte(), interpolate_bilinear_byte(), and blender::scale_bilinear().

◆ interpolate_bilinear_fl() [1/2]

void blender::math::interpolate_bilinear_fl ( const float * buffer,
float * output,
int width,
int height,
int components,
float u,
float v )

◆ interpolate_bilinear_fl() [2/2]

◆ interpolate_bilinear_wrap_byte()

uchar4 blender::math::interpolate_bilinear_wrap_byte ( const uchar * buffer,
int width,
int height,
float u,
float v )
nodiscard

Wrapped bilinear sampling. (u,v) is repeated to be inside the image size, including properly wrapping samples that are right on the edges.

Definition at line 423 of file math_interp.cc.

References b, blender::BLI_assert(), floorf, interpolate_bilinear_wrap_byte(), blender::v, and wrap_coord().

Referenced by blender::imbuf::interpolate_bilinear_wrap_byte(), and interpolate_bilinear_wrap_byte().

◆ interpolate_bilinear_wrap_fl()

float4 blender::math::interpolate_bilinear_wrap_fl ( const float * buffer,
int width,
int height,
float u,
float v )
nodiscard

◆ interpolate_bilinear_wrapmode_fl()

◆ interpolate_cubic_bspline_byte()

uchar4 blender::math::interpolate_cubic_bspline_byte ( const uchar * buffer,
int width,
int height,
float u,
float v )
nodiscard

Cubic B-Spline sampling.

Takes 4x4 image samples at floor(u,v)-1 .. floor(u,v)+2, and blends them based on fractional parts of u,v. Uses B-Spline variant Mitchell-Netravali filter (B=1, C=0), which has no ringing but introduces quite a lot of blur. Samples outside the image are clamped to texels at image edge.

Note that you probably want to subtract 0.5 from u,v before this function, to get proper filtering.

Definition at line 461 of file math_interp.cc.

References bicubic_interpolation(), Extend, interpolate_cubic_bspline_byte(), and blender::v.

Referenced by blender::imbuf::interpolate_cubic_bspline_byte(), blender::imbuf::interpolate_cubic_bspline_byte(), and interpolate_cubic_bspline_byte().

◆ interpolate_cubic_bspline_fl() [1/2]

void blender::math::interpolate_cubic_bspline_fl ( const float * buffer,
float * output,
int width,
int height,
int components,
float u,
float v )

◆ interpolate_cubic_bspline_fl() [2/2]

◆ interpolate_cubic_bspline_wrapmode_fl()

void blender::math::interpolate_cubic_bspline_wrapmode_fl ( const float * buffer,
float * output,
int width,
int height,
int components,
float u,
float v,
math::InterpWrapMode wrap_u,
math::InterpWrapMode wrap_v )

◆ interpolate_cubic_mitchell_byte()

uchar4 blender::math::interpolate_cubic_mitchell_byte ( const uchar * buffer,
int width,
int height,
float u,
float v )
nodiscard

Cubic Mitchell sampling.

Takes 4x4 image samples at floor(u,v)-1 .. floor(u,v)+2, and blends them based on fractional parts of u,v. Uses Mitchell-Netravali filter (B=C=1/3), which has a good compromise between blur and ringing. Samples outside the image are clamped to texels at image edge.

Note that you probably want to subtract 0.5 from u,v before this function, to get proper filtering.

Definition at line 505 of file math_interp.cc.

References bicubic_interpolation(), Extend, interpolate_cubic_mitchell_byte(), and blender::v.

Referenced by blender::imbuf::interpolate_cubic_mitchell_byte(), blender::imbuf::interpolate_cubic_mitchell_byte(), and interpolate_cubic_mitchell_byte().

◆ interpolate_cubic_mitchell_fl() [1/2]

void blender::math::interpolate_cubic_mitchell_fl ( const float * buffer,
float * output,
int width,
int height,
int components,
float u,
float v )

◆ interpolate_cubic_mitchell_fl() [2/2]

float4 blender::math::interpolate_cubic_mitchell_fl ( const float * buffer,
int width,
int height,
float u,
float v )
nodiscard

◆ interpolate_dot_slerp()

template<typename T>
VecBase< T, 2 > blender::math::interpolate_dot_slerp ( const T t,
const T cosom )
inlinenodiscard

Generic function for implementing slerp on the [0, 1] interval (quaternions and spherical vector coords).

Parameters
tfactor in [0..1]
cosomdot product from normalized quaternions.
Returns
calculated weights.

Definition at line 273 of file BLI_math_quaternion.hh.

References abs(), acos(), blender::BLI_assert(), blender::e, eps, IN_RANGE, IN_RANGE_INCL, interpolate_dot_slerp(), sin(), T, and w().

Referenced by interpolate_dot_slerp().

◆ interpolate_fast() [1/6]

template double3x3 blender::math::interpolate_fast ( const double3x3 & a,
const double3x3 & b,
double t )

References b, and interpolate_fast().

◆ interpolate_fast() [2/6]

template double4x4 blender::math::interpolate_fast ( const double4x4 & a,
const double4x4 & b,
double t )

References b, and interpolate_fast().

◆ interpolate_fast() [3/6]

template float3x3 blender::math::interpolate_fast ( const float3x3 & a,
const float3x3 & b,
float t )

References b, and interpolate_fast().

◆ interpolate_fast() [4/6]

template float4x4 blender::math::interpolate_fast ( const float4x4 & a,
const float4x4 & b,
float t )

References b, and interpolate_fast().

◆ interpolate_fast() [5/6]

template<typename T>
MatBase< T, 3, 3 > blender::math::interpolate_fast ( const MatBase< T, 3, 3 > & a,
const MatBase< T, 3, 3 > & b,
T t )
nodiscard

Naive interpolation implementation, faster than polar decomposition

Note
This code is about five times faster than the polar decomposition. However, it gives un-expected results even with non-uniformly scaled matrices, see #46418 for an example.
Parameters
aInput matrix which is totally effective with t = 0.0.
bInput matrix which is totally effective with t = 1.0.
tInterpolation factor.

Definition at line 397 of file math_matrix.cc.

References b, from_rot_scale(), interpolate(), interpolate_fast(), scale(), T, and to_rot_scale().

Referenced by interpolate_fast(), interpolate_fast(), interpolate_fast(), interpolate_fast(), interpolate_fast(), interpolate_fast(), and rotate().

◆ interpolate_fast() [6/6]

template<typename T>
MatBase< T, 4, 4 > blender::math::interpolate_fast ( const MatBase< T, 4, 4 > & a,
const MatBase< T, 4, 4 > & b,
T t )
nodiscard

Naive transform matrix interpolation, based on naive-decomposition-based interpolation from interpolate_fast<T, 3, 3>.

Note
This code is about five times faster than the polar decomposition. However, it gives un-expected results even with non-uniformly scaled matrices, see #46418 for an example.
Parameters
aInput matrix which is totally effective with t = 0.0.
bInput matrix which is totally effective with t = 1.0.
tInterpolation factor.

Definition at line 416 of file math_matrix.cc.

References b, from_loc_rot_scale(), interpolate(), interpolate_fast(), scale(), T, and to_loc_rot_scale().

◆ interpolate_linear()

template<typename T, int NumCol, int NumRow>
MatBase< T, NumCol, NumRow > blender::math::interpolate_linear ( const MatBase< T, NumCol, NumRow > & a,
const MatBase< T, NumCol, NumRow > & b,
T t )
nodiscard

Interpolate each component linearly.

Definition at line 736 of file BLI_math_matrix.hh.

References b, interpolate(), interpolate_linear(), blender::result, T, and blender::unroll().

Referenced by interpolate(), interpolate_linear(), and rotate().

◆ interpolate_nearest_border_byte() [1/2]

uchar4 blender::math::interpolate_nearest_border_byte ( const uchar * buffer,
int width,
int height,
float u,
float v )
inlinenodiscard

Definition at line 134 of file BLI_math_interp.hh.

References interpolate_nearest_border_byte(), and blender::v.

◆ interpolate_nearest_border_byte() [2/2]

void blender::math::interpolate_nearest_border_byte ( const uchar * buffer,
uchar * output,
int width,
int height,
float u,
float v )
inline

Nearest (point) sampling (with black border).

Returns texel at floor(u,v) integer index. Samples outside the image are turned into transparent black.

Note that it is not "nearest to u,v coordinate", but rather with fractional part truncated (it would be "nearest" if subtracting 0.5 from input u,v).

Definition at line 114 of file BLI_math_interp.hh.

References blender::BLI_assert(), blender::data, interpolate_nearest_border_byte(), output, blender::v, blender::x, and y.

Referenced by blender::imbuf::interpolate_nearest_border_byte(), blender::imbuf::interpolate_nearest_border_byte(), interpolate_nearest_border_byte(), and interpolate_nearest_border_byte().

◆ interpolate_nearest_border_fl() [1/2]

void blender::math::interpolate_nearest_border_fl ( const float * buffer,
float * output,
int width,
int height,
int components,
float u,
float v )
inline

◆ interpolate_nearest_border_fl() [2/2]

float4 blender::math::interpolate_nearest_border_fl ( const float * buffer,
int width,
int height,
float u,
float v )
inlinenodiscard

Definition at line 163 of file BLI_math_interp.hh.

References interpolate_nearest_border_fl(), and blender::v.

◆ interpolate_nearest_byte() [1/2]

uchar4 blender::math::interpolate_nearest_byte ( const uchar * buffer,
int width,
int height,
float u,
float v )
inlinenodiscard

Definition at line 195 of file BLI_math_interp.hh.

References interpolate_nearest_byte(), and blender::v.

◆ interpolate_nearest_byte() [2/2]

void blender::math::interpolate_nearest_byte ( const uchar * buffer,
uchar * output,
int width,
int height,
float u,
float v )
inline

Nearest (point) sampling.

Returns texel at floor(u,v) integer index. Samples outside the image are clamped to texels at image edge.

Note that it is not "nearest to u,v coordinate", but rather with fractional part truncated (it would be "nearest" if subtracting 0.5 from input u,v).

Definition at line 181 of file BLI_math_interp.hh.

References blender::BLI_assert(), blender::data, interpolate_nearest_byte(), output, blender::v, blender::x, and y.

Referenced by interpolate_nearest_byte(), and interpolate_nearest_byte().

◆ interpolate_nearest_fl() [1/2]

void blender::math::interpolate_nearest_fl ( const float * buffer,
float * output,
int width,
int height,
int components,
float u,
float v )
inline

◆ interpolate_nearest_fl() [2/2]

float4 blender::math::interpolate_nearest_fl ( const float * buffer,
int width,
int height,
float u,
float v )
inlinenodiscard

Definition at line 216 of file BLI_math_interp.hh.

References interpolate_nearest_fl(), and blender::v.

◆ interpolate_nearest_wrap_byte() [1/2]

uchar4 blender::math::interpolate_nearest_wrap_byte ( const uchar * buffer,
int width,
int height,
float u,
float v )
inlinenodiscard

Definition at line 257 of file BLI_math_interp.hh.

References interpolate_nearest_wrap_byte(), and blender::v.

◆ interpolate_nearest_wrap_byte() [2/2]

void blender::math::interpolate_nearest_wrap_byte ( const uchar * buffer,
uchar * output,
int width,
int height,
float u,
float v )
inline

Wrapped nearest sampling. (u,v) is repeated to be inside the image size.

Definition at line 242 of file BLI_math_interp.hh.

References blender::BLI_assert(), blender::data, interpolate_nearest_wrap_byte(), output, blender::v, wrap_coord(), blender::x, and y.

Referenced by blender::imbuf::interpolate_nearest_wrap_byte(), interpolate_nearest_wrap_byte(), and interpolate_nearest_wrap_byte().

◆ interpolate_nearest_wrap_fl() [1/2]

void blender::math::interpolate_nearest_wrap_fl ( const float * buffer,
float * output,
int width,
int height,
int components,
float u,
float v )
inline

◆ interpolate_nearest_wrap_fl() [2/2]

float4 blender::math::interpolate_nearest_wrap_fl ( const float * buffer,
int width,
int height,
float u,
float v )
inlinenodiscard

Definition at line 279 of file BLI_math_interp.hh.

References interpolate_nearest_wrap_fl(), and blender::v.

◆ interpolate_nearest_wrapmode_fl()

BLI_INLINE void blender::math::interpolate_nearest_wrapmode_fl ( const float * buffer,
float * output,
int width,
int height,
int components,
float u,
float v,
InterpWrapMode wrap_u,
InterpWrapMode wrap_v )

◆ invert() [1/10]

CartesianBasis blender::math::invert ( const CartesianBasis & basis)
inlinenodiscard

Return the inverse transformation represented by the given basis. This is conceptually the equivalent to a rotation matrix transpose, but much faster.

Definition at line 460 of file BLI_math_basis_types.hh.

References blender::math::AxisSigned::axis(), invert(), blender::math::AxisSigned::is_negative(), blender::result, blender::math::Axis::X, blender::math::CartesianBasis::x(), blender::math::AxisSigned::X_NEG, blender::math::AxisSigned::X_POS, blender::math::Axis::Y, blender::math::CartesianBasis::y(), blender::math::AxisSigned::Y_NEG, blender::math::AxisSigned::Y_POS, blender::math::Axis::Z, blender::math::CartesianBasis::z(), blender::math::AxisSigned::Z_NEG, and blender::math::AxisSigned::Z_POS.

Referenced by blender::ed::object::apply_objects_internal(), blender::ed::greasepencil::bake_grease_pencil_animation_exec(), blender::BKE_grease_pencil_point_coords_apply(), blender::BKE_grease_pencil_point_coords_apply_with_mat4(), blender::ed::sculpt_paint::brushes::clay_strips::calc_local_matrix(), blender::calculate_circle_best_fit(), blender::ocio::calculate_white_point_matrix(), blender::nodes::node_fn_invert_matrix_cc::InvertMatrixFunction::call(), chromatic_adaption_matrix(), blender::colormanage_update_matrices(), blender::ed::sculpt_paint::CombOperationExecutor::comb_projected(), blender::nodes::node_geo_bone_info_cc::compute_bone_info(), blender::image_engine::Instance::compute_screen_space_to_sampler_space_transformation(), blender::draw::View::compute_visibility(), blender::ed::sculpt_paint::cube_tip_init(), blender::ed::sculpt_paint::cursor_geometry_info_update(), blender::ed::vse::cursor_set_by_mouse_position(), blender::ed::greasepencil::boolean::curve_boolean_with_planes(), blender::bke::CurvesSurfaceTransforms::CurvesSurfaceTransforms(), blender::ed::sculpt_paint::CutOperationExecutor::cut_curves(), blender::eevee::ShadowTileMap::debug_draw(), blender::nodes::node_geo_deform_curves_on_surface_cc::deform_curves(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_projected(), blender::ocio::display_as_extended_srgb(), blender::ed::sculpt_paint::brushes::do_multiplane_scrape_brush(), blender::ed::sculpt_paint::brushes::do_plane_brush(), blender::io::usd::USDHairWriter::do_write(), blender::ui::draw_but_VECTORSCOPE(), blender::ed::vse::draw_vectorscope_graticule(), blender::ed::greasepencil::DrawingPlacement::DrawingPlacement(), blender::ed::greasepencil::DrawingPlacement::DrawingPlacement(), blender::compositor::RealizeOnDomainOperation::execute(), blender::nodes::node_composite_stabilize_2d_cc::Stabilize2DOperation::execute(), blender::ed::sculpt_paint::PuffOperationExecutor::find_curve_weights_projected(), blender::ed::sculpt_paint::CutOperationExecutor::find_projected_points_in_stroke_with_symmetry(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_projected_smooth_factors(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_projected(), blender::bke::get_armature_deform_params(), blender::get_mirror_matrix(), blender::ed::sculpt_paint::greasepencil::get_screen_projection_fn(), blender::ocio::LibOCIOConfig::get_xyz_to_scene_linear_matrix(), blender::draw::grease_pencil_geom_batch_ensure(), blender::ed::greasepencil::grease_pencil_layer_parent_set(), blender::ed::greasepencil::grease_pencil_paste_strokes_exec(), blender::ed::greasepencil::grease_pencil_reproject_exec(), blender::ed::greasepencil::grease_pencil_snap_to_cursor_exec(), blender::ed::greasepencil::grease_pencil_snap_to_grid_exec(), blender::IMB_colormanagement_file_read_post(), blender::IMB_colormanagement_undo_read_post(), blender::IMB_colormanagement_working_space_convert(), blender::imb_colormanagement_working_space_set_from_matrix(), blender::seq::input_preprocess(), invert(), invert(), invert(), invert(), invert(), invert(), invert(), invert(), invert(), invert(), blender::ed::greasepencil::join_object_with_active(), blender::median_dims_scale_matrix_calc(), blender::ed::greasepencil::merge_layers(), blender::geometry::merge_layers(), blender::ed::sculpt_paint::brushes::multiplane_scrape_preview_draw(), blender::ed::transform::nearest_world_tree(), blender::nodes::node_fn_invert_rotation_cc::node_build_multi_function(), blender::nodes::node_fn_matrix_multiply_cc::node_eval_inverse(), blender::object_grid_element_to_tangent_displacement(), blender::ed::object::object_origin_set_exec(), blender::ed::sculpt_paint::greasepencil::CloneOperation::on_stroke_begin(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::paint_curve_selection_projected(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::paint_point_selection_projected(), blender::draw::ObjectRef::particles_matrix(), blender::ed::curves::convert_from_particle_system::particles_to_curves(), blender::io::grease_pencil::persmat_from_camera_object(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_projected(), blender::ed::sculpt_paint::greasepencil::process_stroke_weights(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::projected_snake_hook(), pseudo_invert(), blender::ed::transform::raycastMesh(), blender::ed::transform::SnapData::register_result(), blender::ed::transform::SnapData::register_result_raycast(), rotation_between(), blender::ed::sculpt_paint::sample_curves_3d_brush(), blender::ed::sculpt_paint::DensityAddOperationExecutor::sample_projected_with_symmetry(), blender::ocio::LibOCIOView::scope_info(), blender::ed::curves::pen_tool::PenToolOperation::screen_to_layer(), blender::ed::sculpt_paint::sculpt_init_mirror_clipping(), blender::sculptsession_update(), blender::bke::greasepencil::Drawing::set_texture_matrices(), blender::eevee::VolumeModule::set_view(), blender::eevee::VolumeProbeModule::set_view(), blender::ed::sculpt_paint::SlideOperationExecutor::slide(), blender::geometry::construct::snap_to_pipe_profile(), blender::ed::transform::snapCamera(), blender::ed::transform::store_transform_properties(), blender::ed::sculpt_paint::stroke_cache_common_init(), blender::draw::View::sync(), blender::eevee::Camera::sync(), ObjectMatrices::sync(), blender::eevee::ShadowTileMap::sync_cubeface(), blender::math::tests::TEST(), blender::math::tests::TEST(), to_dual_quaternion(), transform_normals(), transform_normals(), blender::tests::transform_normals_test(), blender::bke::crazyspace::GeometryDeformation::translation_from_deformed_to_original(), blender::ed::curves::convert_to_particle_system::try_convert_single_object(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_rotate_transform_and_target_property(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_scale_transform_and_target_property(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_translate_transform_and_target_property(), blender::bke::greasepencil::update_triangle_and_offsets_cache(), blender::view3d_ruler_item_mousemove(), blender::draw::volume_grid_cache_get(), blender::workbench_render_to_image(), and blender::ed::AnimTransformable::world_to_local().

◆ invert() [2/10]

template double2x2 blender::math::invert ( const double2x2 & mat,
bool & r_success )

References invert().

◆ invert() [3/10]

template double3x3 blender::math::invert ( const double3x3 & mat,
bool & r_success )

References invert().

◆ invert() [4/10]

template double4x4 blender::math::invert ( const double4x4 & mat,
bool & r_success )

References invert().

◆ invert() [5/10]

template float2x2 blender::math::invert ( const float2x2 & mat,
bool & r_success )

References invert().

◆ invert() [6/10]

template float3x3 blender::math::invert ( const float3x3 & mat,
bool & r_success )

References invert().

◆ invert() [7/10]

template float4x4 blender::math::invert ( const float4x4 & mat,
bool & r_success )

References invert().

◆ invert() [8/10]

template<typename T, int Size>
MatBase< T, Size, Size > blender::math::invert ( const MatBase< T, Size, Size > & mat)
nodiscard

Definition at line 649 of file BLI_math_matrix.hh.

References invert().

◆ invert() [9/10]

template<typename T, int Size>
MatBase< T, Size, Size > blender::math::invert ( const MatBase< T, Size, Size > & mat,
bool & r_success )
nodiscard

Returns the inverse of a square matrix or zero matrix on failure. r_success is optional and set to true if the matrix was inverted successfully.

Definition at line 203 of file math_matrix.cc.

References blender::MatBase< T, NumCol, NumRow, Alignment >::base_ptr(), invert(), M, R, and blender::result.

◆ invert() [10/10]

template<typename T>
QuaternionBase< T > blender::math::invert ( const QuaternionBase< T > & q)
inlinenodiscard

Return invert of q or identity if q is ill-formed. The invert allows quaternion division.

Note
The inverse of q isn't the opposite rotation. This would be the conjugate.

Definition at line 234 of file BLI_math_quaternion.hh.

References conjugate(), dot(), blender::math::QuaternionBase< T >::identity(), invert(), length_squared(), and T.

◆ invert_normalized()

template<typename T>
QuaternionBase< T > blender::math::invert_normalized ( const QuaternionBase< T > & q)
inlinenodiscard

Return invert of q assuming it is a unit quaternion. In this case, the inverse is just the conjugate. conjugate(q) could be use directly, but this function shows the intent better, and asserts if q ever becomes non-unit-length.

Definition at line 244 of file BLI_math_quaternion.hh.

References blender::BLI_assert(), conjugate(), invert_normalized(), and is_unit_scale().

Referenced by blender::xpbd::evaluate_align_rotations_constraint(), interpolate(), invert_normalized(), blender::math::QuaternionBase< T >::swing(), blender::math::tests::TEST(), and blender::math::QuaternionBase< T >::wrapped_around().

◆ is_any_zero() [1/2]

template<typename T>
bool blender::math::is_any_zero ( const T & a)
inline

◆ is_any_zero() [2/2]

template<typename T, int Size>
bool blender::math::is_any_zero ( const VecBase< T, Size > & a)
inlinenodiscard

Returns true if at least one component is exactly equal to 0.

Definition at line 798 of file BLI_math_vector.hh.

References is_any_zero(), and T.

◆ is_equal() [1/3]

◆ is_equal() [2/3]

template<typename T>
bool blender::math::is_equal ( const QuaternionBase< T > & a,
const QuaternionBase< T > & b,
const T epsilon = T(0) )
inlinenodiscard

Returns true if the quaternions are equal within the given epsilon. Return false otherwise.

Definition at line 117 of file BLI_math_quaternion.hh.

References abs(), b, is_equal(), T, blender::math::QuaternionBase< T >::w, blender::math::QuaternionBase< T >::x, blender::math::QuaternionBase< T >::y, and blender::math::QuaternionBase< T >::z.

◆ is_equal() [3/3]

template<typename T, int Size>
bool blender::math::is_equal ( const VecBase< T, Size > & a,
const VecBase< T, Size > & b,
const T epsilon = T(0) )
inlinenodiscard

Returns true if vectors are equal within the given epsilon.

Definition at line 766 of file BLI_math_vector.hh.

References abs(), b, is_equal(), and T.

◆ is_identity()

template<typename T, int NumCol, int NumRow>
bool blender::math::is_identity ( const MatBase< T, NumCol, NumRow > & mat)
inlinenodiscard

Returns true if the matrix is exactly the identity matrix.

Definition at line 528 of file BLI_math_matrix.hh.

References is_identity().

Referenced by blender::seq::apply_modifier_op(), and is_identity().

◆ is_negative() [1/6]

template bool blender::math::is_negative ( const double3x3 & mat)

References is_negative().

◆ is_negative() [2/6]

template bool blender::math::is_negative ( const double4x4 & mat)

References is_negative().

◆ is_negative() [3/6]

template bool blender::math::is_negative ( const float3x3 & mat)

References is_negative().

◆ is_negative() [4/6]

template bool blender::math::is_negative ( const float4x4 & mat)

References is_negative().

◆ is_negative() [5/6]

template<typename T>
bool blender::math::is_negative ( const MatBase< T, 3, 3 > & mat)
nodiscard

Returns true if matrix has inverted handedness.

Note
It doesn't use determinant(mat4x4) as only the 3x3 components are needed assuming the matrix is used as a transformation to represent 3D location/scale/rotation.

Definition at line 143 of file math_matrix.cc.

References determinant(), is_negative(), and T.

Referenced by blender::geometry::execute_realize_mesh_tasks(), interpolate(), is_negative(), is_negative(), is_negative(), is_negative(), is_negative(), is_negative(), blender::geometry::boolean::mesh_bm_concat(), blender::math::detail::normalized_to_quat_fast(), blender::math::AngleFraction< T >::operator AngleCartesianBase< T >(), blender::math::AngleFraction< T >::radian(), to_dual_quaternion(), to_rot_scale(), to_rot_scale(), to_scale(), and to_scale().

◆ is_negative() [6/6]

template<typename T>
bool blender::math::is_negative ( const MatBase< T, 4, 4 > & mat)
nodiscard

◆ is_normalized()

template<typename T>
bool blender::math::is_normalized ( const DualQuaternionBase< T > & dq)
inlinenodiscard

Returns true if the DualQuaternion has not been mixed with other DualQuaternion and needs no normalization.

Definition at line 301 of file BLI_math_quaternion_types.hh.

References is_normalized(), blender::math::DualQuaternionBase< T >::quat_weight, and T.

Referenced by blender::math::detail::from_rotation(), is_normalized(), and transform_point().

◆ is_orthogonal()

template<typename MatT>
bool blender::math::is_orthogonal ( const MatT & mat)
inlinenodiscard

Test if the X, Y and Z axes are perpendicular with each other.

Definition at line 543 of file BLI_math_matrix.hh.

References abs(), dot(), and is_orthogonal().

Referenced by is_orthogonal(), is_orthonormal(), and is_uniformly_scaled().

◆ is_orthonormal()

template<typename MatT>
bool blender::math::is_orthonormal ( const MatT & mat)
inlinenodiscard

◆ is_similarity_transform()

template<typename T>
bool blender::math::is_similarity_transform ( const MatBase< T, 3, 3 > & matrix,
const T & epsilon = 1e-6 )

Check that each column is orthogonal to the others, and that each column is the same length. In other words, there is no shear, and any scaling is uniform.

Definition at line 528 of file math_matrix.cc.

References abs(), dot(), blender::e, is_similarity_transform(), length_squared(), and T.

Referenced by is_similarity_transform(), transform_normals(), and transform_normals().

◆ is_uniformly_scaled()

template<typename MatT>
bool blender::math::is_uniformly_scaled ( const MatT & mat)
inlinenodiscard

Test if the X, Y and Z axes are perpendicular with each other and the same length.

Definition at line 580 of file BLI_math_matrix.hh.

References abs(), blender::e, eps, is_orthogonal(), is_uniformly_scaled(), length_squared(), T, blender::x, y, and z().

Referenced by is_uniformly_scaled().

◆ is_unit()

template<typename T, int Size>
bool blender::math::is_unit ( const VecBase< T, Size > & a,
const T epsilon = T(10) * std::numeric_limits<T>::epsilon() )
inlinenodiscard

Return true if the squared length of the vector is (almost) equal to 1 (with a 10 * std::numeric_limits<T>::epsilon() epsilon error by default).

Definition at line 813 of file BLI_math_vector.hh.

References abs(), is_unit(), length(), length_squared(), and T.

Referenced by blender::xpbd::closest_on_segment_to_ray(), blender::xpbd::intersect_plane(), is_unit(), rotate_direction_around_axis(), and blender::xpbd::CollisionEdgeConstraintSet::solve_single().

◆ is_unit_scale() [1/3]

◆ is_unit_scale() [2/3]

template<typename T>
bool blender::math::is_unit_scale ( const QuaternionBase< T > & q)
inlinenodiscard

◆ is_unit_scale() [3/3]

template<typename T, int Size>
bool blender::math::is_unit_scale ( const VecBase< T, Size > & v)
inlinenodiscard

Return true if each individual column is unit scaled. Mainly for assert usage.

Definition at line 463 of file BLI_math_vector.hh.

References abs(), is_unit_scale(), length_squared(), T, blender::v, and blender::math::AssertUnitEpsilon< T >::value.

◆ is_zero() [1/4]

template<typename T, int NumCol, int NumRow>
bool blender::math::is_zero ( const MatBase< T, NumCol, NumRow > & mat)
inline

Definition at line 594 of file BLI_math_matrix.hh.

References is_zero().

◆ is_zero() [2/4]

template<typename T>
bool blender::math::is_zero ( const QuaternionBase< T > & q)
inlinenodiscard

◆ is_zero() [3/4]

template<typename T>
bool blender::math::is_zero ( const T & a)
inline

Definition at line 23 of file BLI_math_base.hh.

References is_zero(), and T.

Referenced by blender::nodes::node_fn_align_euler_to_vector_cc::align_rotations_auto_pivot(), blender::nodes::node_fn_align_rotation_to_vector_cc::align_rotations_auto_pivot(), blender::nodes::node_fn_align_euler_to_vector_cc::align_rotations_fixed_pivot(), blender::nodes::node_fn_align_rotation_to_vector_cc::align_rotations_fixed_pivot(), blender::ed::sculpt_paint::cloth::apply_filter_forces_bmesh(), blender::ed::sculpt_paint::cloth::apply_filter_forces_grids(), blender::ed::sculpt_paint::cloth::apply_filter_forces_mesh(), blender::apply_stroke_transform(), blender::bmo_flatten_exec(), blender::ed::sculpt_paint::calc_brush_node_mask(), blender::ed::sculpt_paint::calc_brush_plane(), blender::ed::sculpt_paint::cloth::calc_forces_bmesh(), blender::ed::sculpt_paint::cloth::calc_forces_grids(), blender::ed::sculpt_paint::cloth::calc_forces_mesh(), blender::ed::sculpt_paint::brushes::clay_strips::calc_node_mask(), blender::calc_radius_limit(), blender::ed::sculpt_paint::smooth::calc_relaxed_translations_bmesh(), blender::ed::sculpt_paint::smooth::calc_relaxed_translations_faces(), blender::ed::sculpt_paint::smooth::calc_relaxed_translations_grids(), blender::bke::curves::bezier::calculate_aligned_handle(), blender::bke::curves::poly::calculate_next_normal(), blender::bke::curves::poly::calculate_normals_minimum(), blender::ed::sculpt_paint::min_distance_edit::calculate_points_per_side(), blender::geometry::profile::calculate_profile_segments(), blender::nodes::node_fn_axes_to_rotation_cc::AxesToRotationFunction::call(), blender::nodes::node_fn_combine_transform_cc::CombineTransformFunction::call(), blender::ed::sculpt_paint::cloth::cloth_brush_apply_brush_forces(), blender::nodes::node_geo_scale_elements_cc::create_single_axis_transform(), blender::ed::sculpt_paint::brushes::do_bmesh_topology_rake_brush(), blender::ed::sculpt_paint::brushes::do_clay_strips_brush(), blender::ed::sculpt_paint::brushes::do_clay_thumb_brush(), blender::ed::sculpt_paint::color::do_paint_brush(), blender::ed::sculpt_paint::brushes::do_pinch_brush(), blender::ed::sculpt_paint::brushes::do_plane_brush(), blender::ed::transform::drawEdgeSlide(), blender::ed::transform::edge_slide_snap_apply(), blender::bke::subdiv::eval_limit_point_and_derivatives(), blender::geometry::extend_curve_straight(), blender::bke::mesh::face_normal_calc(), blender::geometry::fillet_handle_type(), blender::find_envelope(), blender::bke::float2_to_bool(), blender::bke::float3_to_bool(), blender::bke::float4_to_bool(), from_triangle(), blender::ed::greasepencil::generate_arc_from_point_to_point(), blender::nodes::node_fn_axes_to_rotation_cc::get_orthogonal_of_non_zero_vector(), blender::IMB_colormanagement_working_space_convert(), blender::IMB_colormanagement_working_space_convert(), blender::imb_colormanagement_working_space_init_startup(), blender::imb_colormanagement_working_space_set_from_file(), blender::bke::int2_to_bool(), blender::bke::int3_to_bool(), is_any_zero(), is_zero(), is_zero(), is_zero(), is_zero(), blender::knife_constrain_axis(), blender::geometry::geom::make_unit_square_map(), blender::bke::mesh_translate(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_draw(), blender::ed::transform::mouse_delta_to_world_dir(), blender::geometry::profile::move_profile_plane(), blender::geometry::profile::move_weld_profile_planes(), blender::nodes::node_fn_axis_angle_to_rotation_cc::node_build_multi_function(), blender::nodes::node_fn_rotation_to_axis_angle_cc::node_eval_inverse(), blender::ed::transform::node_snap_grid_apply(), blender::ed::sculpt_paint::pbvh_gather_generic_cube(), blender::geometry::perpendicular_distance(), blender::point_in_slice(), project(), rotate_direction_around_axis(), blender::bke::rotate_directions_around_axes(), blender::bke::short2_to_bool(), blender::bke::CurvesGeometry::translate(), blender::geometry::translate_geometry(), blender::geometry::translate_pointcloud(), blender::ed::view3d::geometry_nodes_gizmos::DialGizmo::update_transform(), blender::ed::view3d::geometry_nodes_gizmos::LinearGizmo::update_transform(), and blender::geometry::zero_degenerate_radii().

◆ is_zero() [4/4]

template<typename T, int Size>
bool blender::math::is_zero ( const VecBase< T, Size > & a,
const T epsilon = T(0) )
inlinenodiscard

Return true if the absolute values of all components are smaller than given epsilon (0 by default).

Note
Does not compute the actual length of the vector, for performance.

Definition at line 785 of file BLI_math_vector.hh.

References abs(), is_zero(), and T.

◆ isect_line_line()

int blender::math::isect_line_line ( const float3 & v1,
const float3 & v2,
const float3 & v3,
const float3 & v4,
float3 & r_i1,
float3 & r_i2 )
inlinenodiscard

Find the closest points between two infinite 3D lines.

Parameters
v1,v2Two points on line A.
v3,v4Two points on line B.
r_i1Closest point on line A to line B.
r_i2Closest point on line B to line A.
Returns
Number of intersection points:
  • 0: Lines are collinear.
  • 1: Lines are coplanar; r_i1 is set to the intersection.
  • 2: r_i1 and r_i2 are the nearest points on each line.

Definition at line 249 of file BLI_math_geom.hh.

References isect_line_line(), blender::isect_line_line_v3(), and blender::v2.

Referenced by blender::calculate_verts(), isect_line_line(), blender::geometry::geom::offset_meet(), blender::geometry::profile::project_to_edge(), blender::geometry::profile::set_profile_params(), blender::geometry::construct::square_out_adj_vmesh(), and TEST().

◆ isect_line_plane()

std::optional< float3 > blender::math::isect_line_plane ( const float3 & l1,
const float3 & l2,
const float3 & plane_co,
const float3 & plane_no )
inlinenodiscard

Intersect the infinite line through (l1, l2) with the plane defined by point plane_co and (not necessarily unit) normal plane_no.

Returns
The intersection point, or std::nullopt when the line is parallel to the plane.

Definition at line 266 of file BLI_math_geom.hh.

References isect_line_plane(), and blender::isect_line_plane_v3().

Referenced by blender::geometry::construct::adjust_miter_coords(), blender::geometry::profile::calculate_profile_segments(), isect_line_plane(), and TEST().

◆ isect_point_poly()

bool blender::math::isect_point_poly ( const float2 & pt,
Span< float2 > verts )
inlinenodiscard

Test whether point pt lies inside a polygon in 2D. Uses the ray-casting method.

Parameters
vertsThe polygon vertices, in order (CW or CCW).
Returns
True when pt is inside the polygon.

Definition at line 339 of file BLI_math_geom.hh.

References blender::Span< T >::data(), isect_point_poly(), blender::isect_point_poly_v2(), and blender::Span< T >::size().

Referenced by blender::edbm_mesh_knife_point_isect(), blender::geometry::construct::face_point_inside_test(), isect_point_poly(), and TEST().

◆ isect_point_quad()

template<typename T>
int blender::math::isect_point_quad ( const VecBase< T, 2 > & p,
const VecBase< T, 2 > & v1,
const VecBase< T, 2 > & v2,
const VecBase< T, 2 > & v3,
const VecBase< T, 2 > & v4 )
inlinenodiscard

Test whether point p lies inside the convex quad (v1, v2, v3, v4) in 2D.

Returns
  • +1: Inside, quad wound counter-clockwise.
  • -1: Inside, quad wound clockwise.
  • 0: Outside.

Definition at line 313 of file BLI_math_geom.hh.

References cross(), isect_point_quad(), T, and blender::v2.

Referenced by isect_point_quad(), and TEST().

◆ isect_point_tri()

template<typename T>
int blender::math::isect_point_tri ( const VecBase< T, 2 > & pt,
const VecBase< T, 2 > & v1,
const VecBase< T, 2 > & v2,
const VecBase< T, 2 > & v3 )
inlinenodiscard

Test whether point pt lies inside the triangle (v1, v2, v3) in 2D.

Returns
  • +1: Inside, triangle wound counter-clockwise.
  • -1: Inside, triangle wound clockwise.
  • 0: Outside.

Definition at line 287 of file BLI_math_geom.hh.

References cross(), isect_point_tri(), T, and blender::v2.

Referenced by isect_point_tri(), and TEST().

◆ isect_seg_seg() [1/3]

◆ isect_seg_seg() [2/3]

◆ isect_seg_seg() [3/3]

◆ length()

template<typename T, int Size>
T blender::math::length ( const VecBase< T, Size > & a)
inlinenodiscard

Definition at line 457 of file BLI_math_vector.hh.

References length(), length_squared(), sqrt(), and T.

Referenced by blender::apply_gradient_tint(), area_tri(), blender::bm_vert_chain_orientation_matrix_calc(), blender::compositor::bokeh(), blender::ed::sculpt_paint::calc_brush_cube_distances(), blender::ed::sculpt_paint::brushes::calc_distances(), blender::bke::curves::bezier::calculate_align_both_handles(), blender::calculate_circle_best_fit(), blender::bke::curves::bezier::calculate_point_handles(), blender::ed::sculpt_paint::min_distance_edit::calculate_points_per_side(), blender::ed::greasepencil::calculate_radius_projection_factor(), blender::nodes::node_shader_tex_gradient_cc::GradientFunction::call(), blender::ed::sculpt_paint::cloth::cloth_brush_satisfy_constraints(), blender::noise::compute_3d_orientation(), blender::compositor::compute_fog_glow_kernel_value(), blender::nodes::node_composite_vector_blur_cc::compute_motion_line(), blender::nodes::node_composite_relative_to_pixel_cc::RelativeToPixelOperation::compute_reference_size(), cotangent_tri_weight(), blender::io::fbx::ArmatureImportContext::create_armature_bones(), blender::ed::transform::createEdgeSlideVerts(), blender::bke::curves::poly::delta_dir(), blender::bke::curves::poly::direction_bisect(), distance(), blender::ed::sculpt_paint::brushes::do_elastic_deform_brush(), blender::ed::sculpt_paint::color::do_smear_brush_task(), blender::xpbd::evaluate_rod_stretch_and_shear_constraint(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_sun_beams(), blender::bke::tests::EXPECT_M3_ORTHOGONAL(), blender::geometry::extend_curve_straight(), blender::geometry::fillet_handle_type(), blender::find_envelope(), float_to_half_array(), float_to_half_clamp_array(), float_to_half_make_finite_array(), from_vector(), blender::draw::View::frustum_culling_planes_calc(), blender::noise::gabor(), blender::noise::gabor(), blender::nodes::node_composite_vector_blur_cc::gather_blur(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_spherical(), blender::nodes::node_composite_vector_blur_cc::gather_sample(), blender::ed::greasepencil::generate_corner(), blender::generate_curves(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::get_delta_translation(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::get_iterations(), blender::nodes::node_fn_compare_cc::get_multi_function(), blender::nodes::gizmos::gizmo_input_dims_from_log(), blender::ed::greasepencil::grease_pencil_primitive_scale_all_update(), half_to_float_array(), blender::geometry::geom::is_outside_edge(), is_unit(), length(), blender::ed::sculpt_paint::filter::mesh_filter_sharpen_init(), blender::ed::sculpt_paint::PaintStroke::modal(), blender::modify_drawing(), blender::nodes::node_geo_mesh_primitive_line_cc::node_geo_exec(), blender::ed::sculpt_paint::paint_stroke_line_constrain(), blender::ed::greasepencil::pixel_radius_to_world_space_radius(), blender::imbuf::transform::process_scanlines(), blender::ed::sculpt_paint::project_brush_radius_grease_pencil(), blender::fn::multi_function::register_common_functions_impl(), blender::eevee::MotionBlurModule::render(), blender::bke::greasepencil::Drawing::set_texture_matrices(), blender::compositor::SMAANeighborhoodBlendingPS(), blender::compositor::SymmetricBlurWeights::SymmetricBlurWeights(), blender::math::tests::TEST(), blender::tests::TEST(), to_axis_angle(), to_scale(), to_scale(), blender::tests::transform_normals_test(), blender::ed::transform::transform_result_get(), blender::math::projection::translate(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_scale_transform_and_target_property(), blender::ed::view3d::geometry_nodes_gizmos::LinearGizmo::update_transform(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_translate_transform_and_target_property(), blender::nodes::node_composite_vector_blur_cc::velocity_atomic_max_value(), whitepoint_to_temp_tint(), and blender::seq::WipeData::WipeData().

◆ length_manhattan()

template<typename T, int Size>
T blender::math::length_manhattan ( const VecBase< T, Size > & a)
inlinenodiscard

◆ length_squared()

template<typename T, int Size>
T blender::math::length_squared ( const VecBase< T, Size > & a)
inlinenodiscard

Definition at line 452 of file BLI_math_vector.hh.

References dot(), length_squared(), and T.

Referenced by blender::geometry::construct::adj_vmesh(), blender::BKE_mball_polygonize(), blender::bke::pbvh::bmesh_update_topology(), blender::calc_min_radius_v3v3(), blender::seq::calc_wipe_blend(), blender::calculate_verts(), blender::xpbd::closest_on_segment_to_ray(), closest_to_line_segment(), closest_to_plane(), blender::noise::compute_2d_gabor_kernel(), blender::noise::compute_2d_gabor_noise_cell(), blender::noise::compute_3d_gabor_kernel(), blender::noise::compute_3d_gabor_noise_cell(), blender::geometry::dist_signed_squared_to_edge(), dist_squared_to_line_segment(), dist_squared_to_plane(), distance_squared(), blender::xpbd::evaluate_align_rotations_constraint(), blender::xpbd::evaluate_rod_stretch_and_shear_constraint(), blender::execute_curve_chain(), blender::ed::sculpt_paint::filter_plane_trim_limit_factors(), blender::ed::greasepencil::grease_pencil_texture_gradient_exec(), invert(), is_orthonormal(), is_similarity_transform(), is_uniformly_scaled(), is_unit(), is_unit_scale(), blender::isect_vert_calc_z(), length(), length_squared(), line_point_factor(), blender::nodes::node_composite_vector_blur_cc::max_velocity(), blender::ed::transform::nearest_world_tree(), normalize_and_get_length(), blender::ed::sculpt_paint::project_translations(), blender::geometry::signed_distance_fat_triangle(), blender::geometry::curve_constraints::solve_length_and_collision_constraints(), blender::xpbd::CollisionEdgeConstraintSet::solve_single(), blender::xpbd::CollisionFaceConstraintSet::solve_single(), to_dual_quaternion(), blender::bke::greasepencil::update_curve_plane_normal_cache(), blender::eevee::Film::update_sample_table(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_scale_transform_and_target_property(), blender::nodes::node_geo_transform_geometry_cc::use_translate(), blender::noise::voronoi_distance_bound(), blender::noise::voronoi_n_sphere_radius(), blender::noise::voronoi_n_sphere_radius(), blender::noise::voronoi_n_sphere_radius(), and blender::WM_gesture_lasso_modal().

◆ line_point_factor()

template<typename T, int Size>
T blender::math::line_point_factor ( const VecBase< T, Size > & p,
const VecBase< T, Size > & l1,
const VecBase< T, Size > & l2 )
inlinenodiscard

Return the scalar factor lambda such that l1 + lambda * (l2 - l1) is the closest point on the infinite line through (l1, l2) to p. Returns 0 when the line is degenerate (l1 == l2). Works for any number of dimensions Size.

Definition at line 199 of file BLI_math_geom.hh.

References dot(), length_squared(), line_point_factor(), and T.

Referenced by line_point_factor(), TEST(), and TEST().

◆ log() [1/2]

template<typename T>
T blender::math::log ( const T & x)
inline

Definition at line 224 of file BLI_math_base.hh.

References log(), T, and blender::x.

Referenced by log(), log(), and blender::tests::TEST().

◆ log() [2/2]

template<typename T, int Size>
VecBase< T, Size > blender::math::log ( const VecBase< T, Size > & x)
inlinenodiscard

Definition at line 291 of file BLI_math_vector.hh.

References BLI_UNROLL_MATH_VEC_OP_VEC, log(), and blender::x.

◆ map_to_sphere()

float2 blender::math::map_to_sphere ( const float3 & co)
inlinenodiscard

Map a 3D direction vector co to spherical (u, v) texture coordinates returned as float2.

Note
Matches map_to_sphere.

Definition at line 461 of file BLI_math_geom.hh.

References blender::map_to_sphere(), map_to_sphere(), and blender::result.

Referenced by map_to_sphere(), and TEST().

◆ max() [1/4]

template<typename T>
T blender::math::max ( const T & a,
const T & b )
inline

Definition at line 49 of file BLI_math_base.hh.

References b, max(), and T.

Referenced by blender::nodes::node_composite_glare_cc::GlareOperation::accumulate_ghosts_cpu(), blender::eevee::RenderBuffers::acquire(), bicubic_interpolation(), blender::BKE_camera_params_from_object(), blender::BKE_camera_params_from_view3d(), blender::BKE_object_minmax_dupli(), blender::BKE_pchan_minmax(), blender::box_select_action(), blender::nodes::node_composite_brightness_contrast_cc::brightness_and_contrast(), blender::gpu::render_graph::VKUpdateMipmapsNode::build_commands(), blender::bke::builtin_attributes(), blender::buttons_context_path_material(), blender::ed::sculpt_paint::calc_brush_cube_distances(), blender::ed::vse::ScopeHistogram::calc_from_ibuf(), blender::nodes::node_shader_radial_tiling_cc::RoundedPolygonFunction::call(), blender::nodes::node_shader_tex_noise_cc::NoiseFunction::call(), blender::Bounds< blender::VecBase< float, 3 > >::center(), blender::nodes::node_composite_channel_key_cc::channel_key(), blender::ed::greasepencil::trim::check_line_segment_lasso_intersection(), clamp(), clamp(), clamp(), blender::nodes::node_composite_color_correction_cc::color_correction(), blender::nodes::node_composite_color_key_cc::color_matte(), blender::compositor::compute_anti_diagonal_start(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_base_ghost_cpu(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_bloom_chain_length(), blender::nodes::node_composite_lens_distortion_cc::compute_chromatic_distortion_scale(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::compute_classic(), blender::nodes::node_composite_crop_cc::CropOperation::compute_cropping_bounds(), blender::compositor::compute_diagonal_start(), blender::nodes::node_composite_lens_distortion_cc::compute_distortion_scale(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::compute_eccentricity(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_image_cpu(), blender::nodes::node_composite_tone_map_cc::ToneMapOperation::compute_log_maximum_luminance(), blender::nodes::node_composite_tone_map_cc::ToneMapOperation::compute_log_minimum_luminance(), blender::nodes::node_composite_tone_map_cc::ToneMapOperation::compute_luminance_scale_blend_factor(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_matte_cpu(), blender::nodes::node_composite_blur_cc::BlurOperation::compute_maximum_blur_size(), blender::nodes::node_composite_vector_blur_cc::compute_motion_rect(), blender::compositor::compute_output_domain(), blender::compositor::compute_sigma_from_radius(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_tweaked_matte_cpu(), blender::nodes::node_composite_bokeh_blur_cc::BokehBlurOperation::compute_variable_size_search_radius(), blender::compositor::convolve(), blender::io::fbx::ArmatureImportContext::create_armature_bones(), blender::create_array_copies(), blender::deform_drawing(), blender::deform_drawing(), blender::nodes::node_composite_difference_key_cc::difference_matte(), blender::nodes::node_composite_distance_key_cc::distance_key(), blender::bke::pbvh::pixels::do_encode_pixels(), blender::do_version_glare_node_bloom_strength(), blender::do_version_map_value_node(), blender::ed::vse::draw_strip_thumbnails(), blender::drawviewborder(), blender::imbuf::transform::edge_aa(), blender::ed::transform::ElementResize(), blender::eevee::LightModule::end_sync(), blender::eevee::VolumeModule::end_sync(), blender::seq::entry_add_or_replace_frame(), blender::evaluate_film_like(), blender::nodes::node_composite_blank_image_cc::BlankImageOperation::execute(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic_cpu(), blender::nodes::node_composite_depth_combin_cc::ZCombineOperation::execute_single_value(), blender::nodes::node_composite_dilate_erode_cc::DilateErodeOperation::execute_step_pass_cpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_sun_beams_cpu(), blender::nodes::node_composite_bokeh_blur_cc::BokehBlurOperation::execute_variable_size_cpu(), blender::nodes::node_composite_scale_cc::ScaleOperation::execute_variable_size_cpu(), blender::geometry::extend_curve_curved(), blender::ed::curves::extend_range(), blender::fcurve_to_keylist(), blender::nodes::FileOutputItemsAccessor::find_available_identifier(), blender::ed::greasepencil::segment::find_intersections_between_curve_and_curves(), blender::ed::sculpt_paint::CutOperationExecutor::find_spherical_cut_boundary(), blender::ed::greasepencil::fit_strokes_to_view(), blender::noise::gabor(), blender::noise::gabor(), blender::seq::gaussian_blur_x(), blender::seq::gaussian_blur_y(), blender::nodes::node_composite_bilateral_blur_cc::BilateralBlurOperation::get_blur_radius(), blender::nodes::node_composite_bokeh_blur_cc::BokehBlurOperation::get_blur_radius(), blender::nodes::node_composite_blur_cc::BlurOperation::get_blur_size(), blender::nodes::node_composite_despeckle_cc::DespeckleOperation::get_color_threshold(), blender::nodes::node_composite_tone_map_cc::ToneMapOperation::get_contrast(), blender::nodes::node_composite_keying_cc::KeyingOperation::get_despill_strength(), blender::get_distance_factor(), blender::nodes::node_composite_keying_cc::KeyingOperation::get_edge_search_size(), blender::nodes::node_composite_defocus_cc::DefocusOperation::get_f_stop(), blender::get_factor_from_draw_speed(), blender::nodes::node_composite_dilate_erode_cc::DilateErodeOperation::get_falloff_size(), blender::nodes::node_composite_defocus_cc::DefocusOperation::get_focal_length(), blender::nodes::node_composite_tone_map_cc::ToneMapOperation::get_gamma(), blender::nodes::node_composite_glare_cc::GlareOperation::get_highlights_smoothness(), blender::nodes::node_composite_id_mask_cc::IDMaskOperation::get_index(), blender::nodes::node_composite_tone_map_cc::ToneMapOperation::get_key(), blender::nodes::node_composite_anti_aliasing_cc::AntiAliasingOperation::get_local_contrast_adaptation_factor(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::get_max_distance(), blender::nodes::node_composite_glare_cc::GlareOperation::get_max_highlights(), blender::nodes::node_composite_glare_cc::GlareOperation::get_normalization_scale(), blender::nodes::node_composite_pixelate_cc::PixelateOperation::get_pixel_size(), blender::nodes::node_composite_keying_cc::KeyingOperation::get_postprocess_blur_size(), blender::nodes::node_composite_keying_cc::KeyingOperation::get_preprocess_blur_size(), blender::nodes::node_composite_glare_cc::GlareOperation::get_saturation(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::get_scale(), blender::nodes::node_composite_scale_cc::ScaleOperation::get_scale_render_size_crop(), blender::nodes::node_composite_vector_blur_cc::VectorBlurOperation::get_shutter(), blender::nodes::node_composite_box_mask_cc::BoxMaskOperation::get_size(), blender::nodes::node_composite_ellipse_mask_cc::EllipseMaskOperation::get_size(), blender::nodes::node_composite_mask_cc::MaskOperation::get_size(), blender::nodes::node_composite_glare_cc::GlareOperation::get_strength(), blender::nodes::node_composite_bilateral_blur_cc::BilateralBlurOperation::get_threshold(), blender::nodes::node_composite_glare_cc::GlareOperation::get_threshold(), blender::ed::greasepencil::get_tri_max_weight(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::get_uniformity(), blender::nodes::node_geo_field_min_and_max_cc::FieldMinMaxInput::get_varray_for_context(), blender::nodes::node_composite_string_to_image_cc::StringToImageOperation::get_wrap_width(), blender::seq::glow_blur_bitmap(), blender::draw::grease_pencil_geom_batch_ensure(), blender::ed::greasepencil::grease_pencil_vertex_paint_brightness_contrast_exec(), blender::nodes::node_composite_hue_correct_cc::hue_correct(), blender::nodes::node_composite_hue_saturation_value_cc::hue_saturation_value(), blender::IMB_create_gpu_texture(), blender::IMB_gpu_texture_apply_partial_update(), blender::imb_gpu_texture_update_region(), blender::eevee::Film::init(), blender::eevee::Sampling::init(), blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::init_auto_masking(), blender::seq::ColorBalanceApplyOp::init_lgg(), blender::seq::ColorBalanceApplyOp::init_sop(), blender::bounds::intersect(), blender::ed::sculpt_paint::CutOperationExecutor::intersect_line_segment_sphere_2d(), blender::compositor::jump_flooding(), blender::ed::object::lattice_add_to_selected_collect_targets_and_calc_bounds(), blender::nodes::node_composite_color_balance_cc::lift_gamma_gain(), max(), max(), max(), max(), blender::compositor::maximum_color_cpu(), blender::compositor::maximum_float2_cpu(), min_max(), min_max(), blender::bounds::detail::min_max_lanes_with_radii(), blender::modify_drawing(), blender::compositor::morphological_distance_cpu(), blender::ed::space_node::node_clipboard_paste_exec(), blender::ed::space_node::node_frame_rect_inside(), blender::ed::space_node::node_get_resize_direction(), blender::draw::overlay::Bounds::object_sync(), blender::geometry::geom::offset_meet(), blender::nodes::node_composite_color_balance_cc::offset_power_slope(), blender::ed::sculpt_paint::greasepencil::RandomizeOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexAverageOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexPaintOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexReplaceOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::PaintOperationExecutor(), blender::eevee::panoramic_equiangular_cubemap_face_view_mask_get(), blender::point_counts_to_keep_concurrent(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), blender::seq::query_thumbnail(), blender::ed::greasepencil::randomize_radius(), blender::eevee::IrradianceBake::raylists_build(), blender::io::spz::read_rotations(), blender::compositor::Domain::realize_transformation(), blender::region_select_action_keys(), blender::fn::multi_function::register_common_functions_impl(), blender::reorder_strokes(), blender::ed::vse::ripple_gaps_get(), blender::scale_up_x_func(), blender::scale_up_y_func(), blender::bke::greasepencil::separate_fill_ids(), blender::seq::seq_prefetch_start_ex(), blender::seq::seq_prefetch_update_area(), blender::ed::vse::sequencer_box_blade_exec(), blender::seq::should_ripple_insert(), blender::compositor::SMAALumaEdgeDetectionPS(), blender::compositor::SMAANeighborhoodBlendingPS(), blender::nodes::node_composite_glare_cc::GlareOperation::smooth_min(), blender::geometry::construct::snap_to_superellipsoid(), blender::ed::space_node::socket_link_connection_location(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::compositor::StringImage::StringImage(), blender::seq::strip_transform_ripple_range(), blender::StatusValue< T >::sum(), blender::eevee::HiZBuffer::sync(), blender::ui::template_ID(), blender::tests::TEST(), blender::gpu::tests::test_mipmap_partial_matches_full(), blender::seq::text_gaussian_blur_x(), blender::seq::text_gaussian_blur_y(), blender::seq::thumbnail_cache_update_scene_thumbs(), blender::seq::tonemap_calc_chunk_luminance(), blender::seq::tonemap_simple(), blender::bounds::transform_bounds(), blender::bounds::transform_bounds(), blender::transform_mpath_point_to_camera(), blender::seq::transform_ripple_ranges_get(), blender::seq::transform_shuffle_vertical(), blender::geometry::tri_to_cell_bounds(), blender::bke::pbvh::TriRasterizer::TriRasterizer(), blender::bke::greasepencil::update_curve_plane_normal_cache(), and blender::ed::greasepencil::vertex_group_normalize_exec().

◆ max() [2/4]

template<typename T, int Size>
VecBase< T, Size > blender::math::max ( const VecBase< T, Size > & a,
const VecBase< T, Size > & b )
inlinenodiscard

Definition at line 88 of file BLI_math_vector.hh.

References b, BLI_UNROLL_MATH_VEC_FUNC_VEC_VEC, and max().

◆ max() [3/4]

template<typename T, int Size>
VecBase< T, Size > blender::math::max ( Span< VecBase< T, Size > > values)
inlinenodiscard

Element-wise maximum of the passed vectors.

Definition at line 97 of file BLI_math_vector.hh.

References blender::BLI_assert(), max(), blender::result, and blender::v.

◆ max() [4/4]

template<typename T, int Size>
VecBase< T, Size > blender::math::max ( std::initializer_list< VecBase< T, Size > > values)
inlinenodiscard

Element-wise maximum of the passed vectors.

Definition at line 113 of file BLI_math_vector.hh.

References max(), and blender::Span< T >::Span().

◆ max_inplace()

◆ midpoint() [1/2]

template<typename T>
T blender::math::midpoint ( const T & a,
const T & b )
inline

See std::midpoint from C++20.

Definition at line 288 of file BLI_math_base.hh.

References b, midpoint(), sign(), and T.

Referenced by blender::BKE_mesh_remap_calc_edges_from_mesh(), blender::bmo_circularize_exec(), blender::bke::pbvh::build_nodes_recursive_grids(), blender::bke::pbvh::build_nodes_recursive_mesh(), blender::bke::calc_edge_centers(), blender::ed::sculpt_paint::filter::calc_sphere_translations(), blender::nodes::node_geo_field_average_cc::calculate_median(), blender::Bounds< T >::center(), blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_points(), blender::ed::sculpt_paint::brushes::do_multiplane_scrape_brush(), blender::edbm_rip_edge_side_measure(), blender::ed::sculpt_paint::ensure_valid_pivot(), blender::ed::space_node::find_visible_center_of_link(), blender::nodes::node_geo_input_mesh_edge_angle_cc::SignedAngleFieldInput::get_varray_for_context(), blender::ed::greasepencil::grease_pencil_snap_cursor_to_sel_exec(), blender::bke::int2_to_int(), midpoint(), midpoint(), blender::ed::object::object_origin_set_exec(), blender::draw::overlay::Bounds::object_sync(), blender::geometry::geom::offset_meet(), blender::paint_init_pivot_curves(), blender::paint_init_pivot_grease_pencil(), blender::paint_init_pivot_mesh(), blender::bke::partition_faces_recursively(), blender::bke::pbvh::pbvh_bmesh_node_limit_ensure_fast(), blender::bke::pbvh::pbvh_bmesh_node_split(), blender::bke::pbvh::pbvh_bmesh_split_edge(), blender::ed::sculpt_paint::dyntopo::sculpt_detail_flood_fill_exec(), blender::geometry::profile::set_profile_params(), blender::bke::short2_to_int(), blender::ed::sculpt_paint::SmoothOperationExecutor::smooth(), blender::geometry::construct::square_out_adj_vmesh(), ObjectInfos::sync(), blender::tests::TEST(), blender::ed::transform::transform_mesh_edge_slide_data_create(), blender::ed::transform::transform_mesh_uv_edge_slide_data_create(), blender::draw::Manager::unique_handle_for_sculpt(), blender::view3d_ob_drop_matrix_from_snap(), and blender::view3d_orbit_calc_center().

◆ midpoint() [2/2]

template<typename T, int Size>
VecBase< T, Size > blender::math::midpoint ( const VecBase< T, Size > & a,
const VecBase< T, Size > & b )
inlinenodiscard
Returns
Point halfway between a and b.

Definition at line 648 of file BLI_math_vector.hh.

References b, and midpoint().

◆ min() [1/4]

template<typename T>
T blender::math::min ( const T & a,
const T & b )
inline

Definition at line 43 of file BLI_math_base.hh.

References b, min(), and T.

Referenced by blender::nodes::node_composite_glare_cc::GlareOperation::adaptive_smooth_clamp(), bicubic_interpolation(), blender::BKE_camera_frame_size(), blender::BKE_object_minmax_dupli(), blender::BKE_path_apply_template_alloc(), blender::BKE_pchan_minmax(), blender::seq::blur_isolate_highlights(), blender::box_select_action(), blender::bke::build_point_matrix_miter_scale(), blender::ed::sculpt_paint::calc_brush_cube_distances(), blender::calc_tile_rect(), blender::ed::space_node::calculate_inner_link_bezier_points(), blender::Bounds< blender::VecBase< float, 3 > >::center(), blender::nodes::node_composite_channel_key_cc::channel_key(), blender::ed::greasepencil::trim::check_line_segment_lasso_intersection(), blender::nodes::node_composite_chroma_key_cc::chroma_matte(), clamp(), clamp(), clamp(), blender::ed::sculpt_paint::greasepencil::closest_distance_to_surface_2d(), blender::nodes::node_composite_color_balance_cc::color_balance(), blender::nodes::node_composite_color_correction_cc::color_correction(), blender::nodes::node_composite_color_key_cc::color_matte(), blender::compositor::compute_anti_diagonal_start(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::compute_classic(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_defocus_radius_from_depth_cpu(), blender::compositor::compute_diagonal_length(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_image_cpu(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_matte_cpu(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_maximum_defocus_radius(), blender::nodes::node_composite_vector_blur_cc::compute_motion_rect(), blender::compositor::compute_output_domain(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_tweaked_matte_cpu(), blender::nodes::node_composite_difference_key_cc::difference_matte(), blender::nodes::node_composite_distance_key_cc::distance_key(), blender::bke::pbvh::pixels::do_encode_pixels(), blender::do_version_glare_node_options_to_inputs(), blender::do_version_map_value_node(), blender::eevee::VolumeModule::end_sync(), blender::draw::gpencil::erfinv_approx(), blender::evaluate_film_like(), blender::nodes::node_composite_pixelate_cc::PixelateOperation::execute_cpu(), blender::nodes::node_composite_dilate_erode_cc::DilateErodeOperation::execute_step_pass_cpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_sun_beams_cpu(), blender::nodes::node_composite_bokeh_blur_cc::BokehBlurOperation::execute_variable_size_cpu(), blender::geometry::extend_curve_curved(), blender::ed::curves::extend_range(), blender::fcurve_to_keylist(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::fill_inpainting_region_cpu(), blender::seq::fill_rect_alpha_under(), blender::find_first_points(), blender::ed::greasepencil::segment::find_intersections_between_curve_and_curves(), blender::index_mask::IndexMask::foreach_segment_zipped(), blender::noise::fractal_voronoi_distance_to_edge(), blender::seq::gaussian_blur_x(), blender::seq::gaussian_blur_y(), blender::get_build_factor(), blender::get_factor_from_draw_speed(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::get_iterations(), blender::io::grease_pencil::get_miter_limit_angle(), blender::nodes::node_composite_scale_cc::ScaleOperation::get_scale_render_size_fit(), blender::nodes::node_geo_field_min_and_max_cc::FieldMinMaxInput::get_varray_for_context(), blender::seq::glow_blur_bitmap(), blender::bounds::intersect(), blender::ed::object::lattice_add_to_selected_collect_targets_and_calc_bounds(), blender::ed::greasepencil::boolean::LR_states_from_segment(), blender::nodes::node_composite_luminance_key_cc::luminance_matte(), blender::bke::calc_edges::mask_first_distinct_edges(), min(), min(), min(), min(), min_max(), min_max(), blender::bounds::detail::min_max_lanes_with_radii(), blender::compositor::minimum_color_cpu(), blender::compositor::morphological_distance_cpu(), blender::ed::space_node::node_add_nodes_modal(), blender::ed::space_node::node_clipboard_paste_exec(), blender::ed::space_node::node_insert_offset_modal(), blender::eevee::panoramic_equiangular_cubemap_face_view_mask_get(), blender::region_select_action_keys(), blender::fn::multi_function::register_common_functions_impl(), blender::ed::vse::ripple_gaps_get(), blender::ed::vse::sequencer_add_effect_strip_exec(), blender::ed::vse::sequencer_box_blade_exec(), blender::ed::vse::sequencer_snap_exec(), blender::eevee::VolumeModule::set_view(), blender::nodes::node_composite_glare_cc::GlareOperation::smooth_min(), blender::geometry::construct::snap_to_superellipsoid(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::compositor::StringImage::StringImage(), blender::seq::strip_transform_ripple_range(), blender::compositor::summed_area_table_sum(), blender::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::seq::text_gaussian_blur_x(), blender::seq::text_gaussian_blur_y(), blender::seq::tonemap_calc_chunk_luminance(), blender::bounds::transform_bounds(), blender::bounds::transform_bounds(), blender::seq::transform_shuffle_vertical(), blender::geometry::tri_to_cell_bounds(), blender::bke::pbvh::TriRasterizer::TriRasterizer(), blender::nodes::node_composite_vector_blur_cc::velocity_atomic_max_value(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_distance_to_edge(), and blender::nodes::node_composite_color_balance_cc::white_point_constant().

◆ min() [2/4]

template<typename T, int Size>
VecBase< T, Size > blender::math::min ( const VecBase< T, Size > & a,
const VecBase< T, Size > & b )
inlinenodiscard

Definition at line 57 of file BLI_math_vector.hh.

References b, BLI_UNROLL_MATH_VEC_FUNC_VEC_VEC, and min().

◆ min() [3/4]

template<typename T, int Size>
VecBase< T, Size > blender::math::min ( Span< VecBase< T, Size > > values)
inlinenodiscard

Element-wise minimum of the passed vectors.

Definition at line 66 of file BLI_math_vector.hh.

References blender::BLI_assert(), min(), blender::result, and blender::v.

◆ min() [4/4]

template<typename T, int Size>
VecBase< T, Size > blender::math::min ( std::initializer_list< VecBase< T, Size > > values)
inlinenodiscard

Element-wise minimum of the passed vectors.

Definition at line 82 of file BLI_math_vector.hh.

References min(), and blender::Span< T >::Span().

◆ min_inplace()

template<typename T>
void blender::math::min_inplace ( T & a,
const T & b )
inline

Definition at line 62 of file BLI_math_base.hh.

References b, min_inplace(), and T.

Referenced by min_inplace(), and blender::io::obj::Geometry::track_vertex_index().

◆ min_max() [1/2]

◆ min_max() [2/2]

template<typename T, int Size>
void blender::math::min_max ( const VecBase< T, Size > & vector,
VecBase< T, Size > & min,
VecBase< T, Size > & max )
inline

Definition at line 332 of file BLI_math_vector.hh.

References max(), min(), and min_max().

◆ mod() [1/3]

◆ mod() [2/3]

template<typename T, int Size>
VecBase< T, Size > blender::math::mod ( const VecBase< T, Size > & a,
const T & b )
inlinenodiscard

Definition at line 164 of file BLI_math_vector.hh.

References b, blender::BLI_assert(), mod(), blender::result, and T.

◆ mod() [3/3]

template<typename T, int Size>
VecBase< T, Size > blender::math::mod ( const VecBase< T, Size > & a,
const VecBase< T, Size > & b )
inlinenodiscard

Definition at line 158 of file BLI_math_vector.hh.

References b, BLI_UNROLL_MATH_VEC_FUNC_VEC_VEC, and mod().

◆ mod_periodic()

◆ normal_quad()

template<typename T>
VecBase< T, 3 > blender::math::normal_quad ( const VecBase< T, 3 > & v1,
const VecBase< T, 3 > & v2,
const VecBase< T, 3 > & v3,
const VecBase< T, 3 > & v4 )
inlinenodiscard

Compute the normalized normal of a quad (v1, v2, v3, v4). Uses the cross product of the two diagonals, so the result is correct for planar quads and a reasonable approximation for slightly non-planar ones. The result is not guaranteed to be non-degenerate.

Definition at line 32 of file BLI_math_geom.hh.

References cross(), normal_quad(), normalize(), and blender::v2.

Referenced by normal_quad(), and TEST().

◆ normal_tri()

template<typename T>
VecBase< T, 3 > blender::math::normal_tri ( const VecBase< T, 3 > & v1,
const VecBase< T, 3 > & v2,
const VecBase< T, 3 > & v3 )
inlinenodiscard

◆ normalize() [1/5]

template<typename T>
DualQuaternionBase< T > blender::math::normalize ( const DualQuaternionBase< T > & dual_quat)
nodiscard

Apply all accumulated weights to the dual-quaternions. Also make sure the rotation quaternions is normalized.

Note
The C version of this function does not normalize the quaternion. This makes other operations like transform and matrix conversion more complex.
Returns identity DualQuaternion if degenerate.

Definition at line 451 of file BLI_math_quaternion.hh.

References dot(), blender::math::DualQuaternionBase< T >::identity(), normalize(), blender::math::DualQuaternionBase< T >::quat, blender::math::DualQuaternionBase< T >::quat_weight, blender::math::DualQuaternionBase< T >::scale, blender::math::DualQuaternionBase< T >::scale_weight, sqrt(), T, and blender::math::DualQuaternionBase< T >::trans.

◆ normalize() [2/5]

template<typename T, int NumCol, int NumRow>
MatBase< T, NumCol, NumRow > blender::math::normalize ( const MatBase< T, NumCol, NumRow > & a)
nodiscard

Normalize each column of the matrix individually.

Definition at line 784 of file BLI_math_matrix.hh.

References normalize(), blender::result, and blender::unroll().

Referenced by blender::bke::mesh::accumulate_fan_normal(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::active_jitter(), blender::geometry::construct::adjust_miter_coords(), blender::geometry::construct::adjust_miter_inner_coords(), blender::ed::sculpt_paint::pose::align_pivot_local_space(), blender::nodes::node_fn_align_euler_to_vector_cc::align_rotations_auto_pivot(), blender::nodes::node_fn_align_rotation_to_vector_cc::align_rotations_auto_pivot(), blender::nodes::node_fn_align_rotation_to_vector_cc::align_rotations_fixed_pivot(), blender::xpbd::apply_rotation_offset(), blender::armature_bone_primitive_add_exec(), blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), blender::draw::overlay::Meshes::begin_sync(), blender::draw::overlay::Paints::begin_sync(), blender::ed::sculpt_paint::boundary::bend_data_init_bmesh(), blender::ed::sculpt_paint::boundary::bend_data_init_grids(), blender::ed::sculpt_paint::boundary::bend_data_init_mesh(), blender::BKE_multires_construct_tangent_matrix(), blender::BM_face_splits_check_legal(), blender::bm_vert_chain_orientation_matrix_calc(), blender::bmo_circularize_exec(), blender::bke::build_point_matrix(), blender::bke::build_point_matrix_miter_scale(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_bmesh(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_grids(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_mesh(), blender::ed::sculpt_paint::smooth::calc_boundary_normal_corner(), blender::ed::sculpt_paint::smooth::calc_boundary_normal_corner(), blender::ed::sculpt_paint::smooth::calc_boundary_normal_corner(), blender::ed::sculpt_paint::calc_brush_plane(), blender::bke::mesh::calc_edge_directions(), blender::ed::sculpt_paint::cloth::calc_forces_bmesh(), blender::ed::sculpt_paint::cloth::calc_forces_grids(), blender::ed::sculpt_paint::cloth::calc_forces_mesh(), blender::ed::sculpt_paint::brushes::clay_strips::calc_local_matrix(), blender::ed::sculpt_paint::cloth::calc_perpendicular_pinch_forces(), blender::ed::sculpt_paint::cloth::calc_pinch_forces(), blender::ed::sculpt_paint::cloth::calc_plane_pinch_forces(), blender::ed::sculpt_paint::pose::calc_pose_data(), blender::geometry::calc_position_with_interpolation(), blender::geometry::calc_position_without_interpolation(), blender::ed::sculpt_paint::pose::calc_scale_from_grab_delta(), blender::ed::sculpt_paint::filter::calc_sphere_translations(), blender::ed::sculpt_paint::calc_stabilized_plane(), blender::bke::curves::bezier::calculate_align_both_handles(), blender::bke::curves::bezier::calculate_aligned_handle(), blender::geometry::calculate_directions(), blender::bke::curves::poly::calculate_next_normal(), blender::bke::curves::poly::calculate_normals_minimum(), blender::bke::curves::poly::calculate_normals_z_up(), blender::calculate_plane(), blender::ed::sculpt_paint::min_distance_edit::calculate_points_per_side(), blender::calculate_target_locations(), blender::ed::greasepencil::calculate_texture_space(), blender::calculate_verts(), blender::nodes::node_fn_axes_to_rotation_cc::AxesToRotationFunction::call(), blender::nodes::node_fn_separate_transform_cc::SeparateTransformFunction::call(), blender::nodes::node_geo_curve_sample_cc::SampleCurveFunction::call(), blender::nodes::node_composite_chroma_key_cc::chroma_matte(), blender::ed::sculpt_paint::cloth::cloth_brush_apply_brush_forces(), blender::nodes::node_geo_curve_primitive_arc_cc::colinear_f3_f3_f3(), blender::nodes::node_geo_curve_primitive_circle_cc::colinear_f3_f3_f3(), blender::ed::sculpt_paint::greasepencil::compute_auto_flip(), blender::geometry::compute_surface_point_normal(), blender::io::ply::convert_gsplat_ply_to_point_cloud(), blender::bke::mesh::corner_fan_space_define(), blender::bke::mesh::corner_space_custom_normal_to_data(), blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_points(), blender::nodes::node_geo_curve_primitive_line_cc::create_direction_line_curve(), blender::nodes::node_geo_curve_primitive_circle_cc::create_point_circle_curve(), blender::nodes::node_geo_scale_elements_cc::create_single_axis_transform(), blender::ed::sculpt_paint::cursor_geometry_info_update(), blender::deform_drawing(), blender::bke::curves::poly::direction_bisect(), blender::ed::sculpt_paint::boundary::displacement_from_grab_delta_get(), blender::ed::sculpt_paint::brushes::do_bmesh_topology_rake_brush(), blender::ed::sculpt_paint::brushes::do_multiplane_scrape_brush(), blender::ed::sculpt_paint::brushes::do_pinch_brush(), blender::ed::sculpt_paint::brushes::do_plane_brush(), blender::ed::sculpt_paint::color::do_smear_brush_task(), blender::do_version_normal_node_dot_product(), blender::io::usd::USDPointInstancerWriter::do_write(), blender::drw_render_border_mask(), blender::DRW_text_edit_mesh_measure_stats(), blender::dynamic_paint_paint_mesh_cell_point_cb_ex(), blender::edbm_flatten_exec(), blender::edbm_rip_edge_exec(), blender::geometry::construct::edges_angle_kind(), blender::bke::subdiv::eval_limit_point_and_normal(), blender::bke::CurvesGeometry::evaluated_tangents(), blender::geometry::extend_curve_curved(), blender::geometry::fillet_handle_type(), blender::ed::sculpt_paint::SlideOperationExecutor::find_curves_to_slide(), blender::find_envelope(), blender::find_internal_spring_target_vertex(), blender::ed::greasepencil::segment::find_intersections_between_curve_and_curves(), blender::bke::float4x4_to_quaternion(), from_triangle(), from_vector(), blender::noise::gabor(), blender::ed::greasepencil::generate_cap(), blender::ed::greasepencil::generate_corner(), blender::ed::greasepencil::generate_stroke_perimeter(), blender::ed::sculpt_paint::trim::gesture_to_screen_points(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::get_axis_gizmo_matrix_basis(), blender::nodes::node_composite_normal_cc::get_normal(), blender::nodes::node_geo_input_mesh_edge_angle_cc::SignedAngleFieldInput::get_varray_for_context(), blender::gizmo_ruler_draw(), blender::ed::sculpt_paint::grease_pencil_fill_get_extension_data(), blender::ed::greasepencil::grease_pencil_reproject_exec(), blender::ed::sculpt_paint::imapaint_pick_face(), blender::ed::sculpt_paint::gesture::init_common(), blender::ed::transform::initVertSlide_ex(), interpolate(), blender::knife_draw_line(), blender::knife_find_closest_edge_of_face(), blender::knife_snap_update_from_mval(), blender::ed::sculpt_paint::gesture::line_plane_from_tri(), blender::ed::greasepencil::boolean::LR_states_from_segment(), blender::geometry::construct::make_cube_corner_adj_vmesh(), blender::ed::view3d::geometry_nodes_gizmos::make_matrix_orthonormal_but_keep_z_axis(), blender::geometry::geom::make_unit_square_map(), blender::bke::mesh_normals_varray(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_draw(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_invoke(), blender::bke::attribute_math::mix3(), blender::bke::subdiv::mix_normals(), blender::bke::subdiv::mix_normals(), blender::bke::subdiv::mix_normals(), blender::ed::transform::mouse_delta_to_world_dir(), blender::geometry::profile::move_profile_plane(), blender::multires_reshape_apply_base_refit_base_mesh(), blender::geometry::geom::nearly_parallel(), blender::geometry::construct::next_edgehalf_bev(), blender::nodes::node_fn_axis_angle_to_rotation_cc::node_build_multi_function(), blender::nodes::node_fn_quaternion_to_rotation_cc::node_build_multi_function(), blender::nodes::node_fn_rotation_to_axis_angle_cc::node_eval_inverse(), blender::nodes::node_geo_mesh_primitive_line_cc::node_geo_exec(), normal_quad(), blender::nodes::node_geo_distribute_points_on_faces_cc::normal_to_rotation(), normal_tri(), normalize(), normalize(), normalize(), normalize(), normalize(), blender::bke::normalize_span(), blender::geometry::normalize_span(), blender::draw::overlay::LightProbes::object_sync(), blender::geometry::construct::offset_in_plane(), blender::geometry::geom::offset_meet(), blender::ed::sculpt_paint::greasepencil::RandomizeOperation::on_stroke_extended(), orthogonalize(), blender::draw::detail::pack_gaussian(), blender::bke::pbvh::pbvh_bmesh_split_edge(), blender::geometry::construct::pipe_test(), blender::geometry::geom::point_between_edges(), blender::ed::sculpt_paint::boundary::populate_twist_data(), pow(), blender::ed::curves::primitive_random_sphere(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), blender::ed::sculpt_paint::PuffOperationExecutor::puff(), blender::nodes::node_geo_raycast_cc::raycast_to_mesh(), blender::fn::multi_function::register_common_functions_impl(), blender::ed::transform::SnapData::register_result(), blender::ed::transform::SnapData::register_result_raycast(), blender::ed::greasepencil::DrawingPlacement::reproject(), blender::bke::mesh_surface_sample::sample_corner_normals(), blender::ed::sculpt_paint::sample_curves_3d_brush(), blender::bke::mesh_surface_sample::sample_point_normals(), blender::ed::sculpt_paint::AddOperationExecutor::sample_spherical_with_symmetry(), blender::bke::mesh_surface_sample::sample_surface_points_projected(), blender::bke::mesh_surface_sample::sample_surface_points_spherical(), blender::geometry::profile::set_profile_params(), blender::ed::sculpt_paint::boundary::slide_data_init_bmesh(), blender::ed::sculpt_paint::boundary::slide_data_init_grids(), blender::ed::sculpt_paint::boundary::slide_data_init_mesh(), blender::geometry::construct::snap_to_superellipsoid(), blender::ed::sculpt_paint::pose::solve_ik_chain(), blender::geometry::curve_constraints::solve_length_and_collision_constraints(), blender::geometry::curve_constraints::solve_length_constraints(), blender::ed::sculpt_paint::pose::solve_roll_chain(), blender::geometry::construct::square_out_adj_vmesh(), blender::draw::statvis_calc_thickness(), blender::io::obj::OBJMesh::store_normal_coords_and_indices(), blender::ed::sculpt_paint::stroke_cache_common_init(), blender::ed::sculpt_paint::stroke_cache_init(), TEST(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::io::ply::TEST_F(), blender::ed::sculpt_paint::tilt_apply_to_normal(), to_dual_quaternion(), to_quaternion_legacy(), blender::ed::transform::transform_mesh_edge_slide_data_create(), blender::ed::transform::transform_mesh_uv_edge_slide_data_create(), transform_normals(), transform_normals(), blender::tests::transform_normals_test(), blender::geometry::transform_volume(), blender::ed::transform::VertSlideData::update_active_edges(), blender::bke::greasepencil::update_curve_plane_normal_cache(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_rotate_transform_and_target_property(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_scale_transform_and_target_property(), blender::ed::view3d::geometry_nodes_gizmos::DialGizmo::update_transform(), blender::ed::view3d::geometry_nodes_gizmos::LinearGizmo::update_transform(), blender::value_attribute_to_matrix(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_distance_to_edge(), whitepoint_from_temp_tint(), and blender::wm_xr_navigation_teleport_arc_scene_intersect().

◆ normalize() [3/5]

template<typename T, int NumCol, int NumRow, int SrcNumCol, int SrcNumRow, int SrcStartCol, int SrcStartRow, int SrcAlignment>
MatBase< T, NumCol, NumRow > blender::math::normalize ( const MatView< T, NumCol, NumRow, SrcNumCol, SrcNumRow, SrcStartCol, SrcStartRow, SrcAlignment > & a)
nodiscard

Definition at line 753 of file BLI_math_matrix.hh.

References normalize(), blender::result, and blender::unroll().

◆ normalize() [4/5]

template<typename T>
QuaternionBase< T > blender::math::normalize ( const QuaternionBase< T > & q)
inlinenodiscard

Return a unit quaternion representing the same rotation as q or the identity quaternion if q is ill-formed.

Definition at line 258 of file BLI_math_quaternion.hh.

References len(), normalize(), normalize_and_get_length(), and T.

◆ normalize() [5/5]

template<typename T, int Size>
VecBase< T, Size > blender::math::normalize ( const VecBase< T, Size > & v)
inlinenodiscard

Definition at line 543 of file BLI_math_vector.hh.

References len(), normalize(), normalize_and_get_length(), T, and blender::v.

◆ normalize_and_get_length() [1/2]

template<typename T>
QuaternionBase< T > blender::math::normalize_and_get_length ( const QuaternionBase< T > & q,
T & out_length )
inlinenodiscard

Definition at line 251 of file BLI_math_quaternion.hh.

References dot(), blender::math::QuaternionBase< T >::identity(), normalize_and_get_length(), sqrt(), and T.

Referenced by blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), blender::bke::build_point_matrix_miter_scale(), blender::ed::sculpt_paint::cloth::cloth_brush_solve_collision(), blender::convexhull_2d_angle_iter_init(), blender::convexhull_2d_angle_iter_step_on_axis(), blender::distfactor_to_bone(), blender::xpbd::evaluate_distance_constraint(), blender::math::QuaternionBase< T >::expmap(), blender::geometry::extend_curve_curved(), blender::ed::greasepencil::find_curve_intersections(), from_vector(), blender::ed::sculpt_paint::grease_pencil_fill_extension_cut(), blender::ed::sculpt_paint::grease_pencil_fill_get_extension_data(), blender::geometry::profile::move_profile_plane(), blender::geometry::profile::move_weld_profile_planes(), blender::bke::node_foreach_working_space_color(), normalize(), normalize(), normalize_and_get_length(), normalize_and_get_length(), normalize_and_get_size(), normalize_and_get_size(), blender::bke::pbvh::normals_calc_verts_simple(), orthogonalize(), blender::project_on_mesh(), blender::ed::sculpt_paint::raycast_init(), blender::ed::transform::raycastMesh(), blender::geometry::geom::slide_dist(), blender::geometry::curve_constraints::solve_length_and_collision_constraints(), blender::xpbd::AngularDampingConstraintSet::solve_single(), blender::xpbd::CollisionEdgeConstraintSet::solve_single(), blender::xpbd::FrictionEdgeConstraintSet::solve_single(), blender::xpbd::FrictionFaceConstraintSet::solve_single(), blender::xpbd::LinearDampingConstraintSet::solve_single(), blender::ed::transform::transform_mesh_edge_slide_data_create(), blender::bke::greasepencil::update_curve_plane_normal_cache(), blender::math::QuaternionBase< T >::wrapped_around(), and blender::write_fill_transforms().

◆ normalize_and_get_length() [2/2]

template<typename T, int Size>
VecBase< T, Size > blender::math::normalize_and_get_length ( const VecBase< T, Size > & v,
T & out_length )
inlinenodiscard

◆ normalize_and_get_size() [1/2]

template<typename T, int NumCol, int NumRow, typename VectorT>
MatBase< T, NumCol, NumRow > blender::math::normalize_and_get_size ( const MatBase< T, NumCol, NumRow > & a,
VectorT & r_size )
nodiscard

◆ normalize_and_get_size() [2/2]

template<typename T, int NumCol, int NumRow, int SrcNumCol, int SrcNumRow, int SrcStartCol, int SrcStartRow, int SrcAlignment, typename VectorT>
MatBase< T, NumCol, NumRow > blender::math::normalize_and_get_size ( const MatView< T, NumCol, NumRow, SrcNumCol, SrcNumRow, SrcStartCol, SrcStartRow, SrcAlignment > & a,
VectorT & r_size )
nodiscard

◆ normalized_to_quaternion_safe()

template<typename T>
QuaternionBase< T > blender::math::normalized_to_quaternion_safe ( const MatBase< T, 3, 3 > & mat)
inlinenodiscard

This is "safe" in the sense that the input matrix may not actually encode a rotation but can also contain shearing etc.

Definition at line 1291 of file BLI_math_matrix.hh.

References normalized_to_quaternion_safe(), to_euler(), and to_quaternion().

Referenced by blender::nodes::node_fn_separate_transform_cc::SeparateTransformFunction::call(), blender::bke::float4x4_to_quaternion(), blender::bke::attribute_math::mix3(), normalized_to_quaternion_safe(), and blender::tests::TEST().

◆ operator<<() [1/4]

std::ostream & blender::math::operator<< ( std::ostream & stream,
const Axis axis )

Definition at line 15 of file math_basis_types.cc.

◆ operator<<() [2/4]

std::ostream & blender::math::operator<< ( std::ostream & stream,
const AxisSigned axis )

Definition at line 29 of file math_basis_types.cc.

◆ operator<<() [3/4]

std::ostream & blender::math::operator<< ( std::ostream & stream,
const CartesianBasis & rot )

Definition at line 44 of file math_basis_types.cc.

◆ operator<<() [4/4]

std::ostream & blender::math::operator<< ( std::ostream & stream,
EulerOrder order )

Definition at line 144 of file math_rotation.cc.

References operator<<(), XYZ, XZY, YXZ, YZX, ZXY, and ZYX.

Referenced by operator<<().

◆ operator<=() [1/2]

bool blender::math::operator<= ( const Axis::Value a,
const Axis::Value b )
constexpr

Definition at line 185 of file BLI_math_basis_types.hh.

References b, and operator<=().

Referenced by operator<=(), and operator<=().

◆ operator<=() [2/2]

bool blender::math::operator<= ( const AxisSigned::Value a,
const AxisSigned::Value b )
constexpr

Definition at line 190 of file BLI_math_basis_types.hh.

References b, and operator<=().

◆ orthogonal() [1/2]

template<typename T>
VecBase< T, 2 > blender::math::orthogonal ( const VecBase< T, 2 > & v)
inlinenodiscard

Calculates a perpendicular vector to v.

Note
Returned vector can be in any perpendicular direction.

Definition at line 757 of file BLI_math_vector.hh.

References orthogonal(), and blender::v.

◆ orthogonal() [2/2]

template<typename T>
VecBase< T, 3 > blender::math::orthogonal ( const VecBase< T, 3 > & v)
inlinenodiscard

Calculates a perpendicular vector to v.

Note
Returned vector can be in any perpendicular direction.
Returned vector might not the same length as v.

Definition at line 739 of file BLI_math_vector.hh.

References dominant_axis(), orthogonal(), and blender::v.

Referenced by blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), blender::ed::transform::isect_face_dst(), orthogonal(), and orthogonal().

◆ orthogonalize()

template<typename MatT>
MatT blender::math::orthogonalize ( const MatT & mat,
const Axis axis )
nodiscard

This returns a version of mat with orthonormal basis axes. This leaves the given axis untouched.

In other words this removes the shear of the matrix. However this doesn't properly account for volume preservation, and so, the axes keep their respective length.

Note
Prefer using from_up_axis to create a orthogonal basis around a vector.

The secondary axis is chosen as follow (X->Y, Y->X, Z->X). If this axis is co-planar try the third axis. If also co-planar, make up an axis by shuffling the primary axis coordinates (XYZ > YZX).

Definition at line 1534 of file BLI_math_matrix.hh.

References BLI_assert_unreachable, cross(), dot(), normalize(), normalize_and_get_length(), orthogonalize(), R, blender::result, scale(), T, blender::math::Axis::X, blender::math::Axis::Y, and blender::math::Axis::Z.

Referenced by orthogonalize(), rotate(), and to_dual_quaternion().

◆ plane_from_point_normal()

template<typename T>
VecBase< T, 4 > blender::math::plane_from_point_normal ( const VecBase< T, 3 > & co,
const VecBase< T, 3 > & no )
inlinenodiscard

◆ plane_point_side()

template<typename T>
T blender::math::plane_point_side ( const VecBase< T, 4 > & plane,
const VecBase< T, 3 > & co )
inlinenodiscard

Return the signed distance of co from plane. Positive values are on the side the normal points toward.

Note
The plane normal need not be unit length; the result is scaled accordingly.

Definition at line 94 of file BLI_math_geom.hh.

References plane_point_side(), and T.

Referenced by closest_to_plane(), dist_squared_to_plane(), plane_point_side(), and TEST().

◆ polar_decompose()

template<typename T>
void blender::math::polar_decompose ( const MatBase< T, 3, 3 > & mat3,
MatBase< T, 3, 3 > & r_U,
MatBase< T, 3, 3 > & r_P )
static

Right polar decomposition: M = UP

U is the rotation-like component, the closest orthogonal matrix to M. P is the scaling-like component, defined in U space.

See https://en.wikipedia.org/wiki/Polar_decomposition for more.

WORKAROUND: (ComputeThinU | ComputeThinV) must be set as runtime parameters in Eigen < 3.4.0. But this requires the matrix type to be dynamic to avoid an assert.

Definition at line 292 of file math_matrix.cc.

References blender::MatBase< T, NumCol, NumRow, Alignment >::base_ptr(), from_scale(), polar_decompose(), transpose(), V, and W.

Referenced by interpolate(), and polar_decompose().

◆ poly_to_tri_count()

int blender::math::poly_to_tri_count ( const int poly_count,
const int corner_count )
nodiscardconstexpr

Compute the total number of triangles needed to tessellate a mesh, or the index of the first triangle for a polygon given its loop start index.

Parameters
poly_countNumber of polygons (or polygon index).
corner_countNumber of corners / loop index.
Note
Derived from the geometric identity that each n-gon (n >= 3) requires (n - 2) triangles.

Definition at line 382 of file BLI_math_geom.hh.

References poly_to_tri_count().

Referenced by poly_to_tri_count(), and TEST().

◆ pow() [1/4]

template<typename T>
QuaternionBase< T > blender::math::pow ( const QuaternionBase< T > & q,
const T & y )
nodiscard

Raise a unit Quaternion q to the real y exponent.

Note
This only works on unit quaternions and y != 0.
This is not a per component power.

Definition at line 204 of file BLI_math_quaternion.hh.

References blender::BLI_assert(), cos(), blender::math::QuaternionBase< T >::imaginary_part(), is_unit_scale(), normalize(), pow(), safe_acos(), sin(), T, blender::math::QuaternionBase< T >::w, and y.

◆ pow() [2/4]

◆ pow() [3/4]

template<typename T, int Size>
VecBase< T, Size > blender::math::pow ( const VecBase< T, Size > & x,
const T & y )
inlinenodiscard

Return the value of x raised to the y power. The result is undefined if x < 0 or if x = 0 and y <= 0.

Definition at line 228 of file BLI_math_vector.hh.

References pow(), blender::result, T, blender::x, and y.

◆ pow() [4/4]

template<typename T, int Size>
VecBase< T, Size > blender::math::pow ( const VecBase< T, Size > & x,
const VecBase< T, Size > & y )
inlinenodiscard

Return the value of x raised to the y power. The result is undefined if x < 0 or if x = 0 and y <= 0.

Definition at line 272 of file BLI_math_vector.hh.

References BLI_UNROLL_MATH_VEC_FUNC_VEC_VEC, pow(), blender::x, and y.

◆ project()

template<typename T, int Size>
VecBase< T, Size > blender::math::project ( const VecBase< T, Size > & p,
const VecBase< T, Size > & v_proj )
inlinenodiscard

Project p onto v_proj . Returns zero vector if v_proj is degenerate (zero length).

Definition at line 517 of file BLI_math_vector.hh.

References dot(), is_zero(), project(), and blender::VecBase< T, Size >::VecBase().

Referenced by project(), and blender::fn::multi_function::register_common_functions_impl().

◆ project_point() [1/4]

template float2 blender::math::project_point ( const float3x3 & mat,
const float2 & point )
extern

References project_point().

◆ project_point() [2/4]

template float3 blender::math::project_point ( const float4x4 & mat,
const float3 & point )
extern

References project_point().

◆ project_point() [3/4]

template<typename T, int N, int NumRow>
VecBase< T, N > blender::math::project_point ( const MatBase< T, N+1, NumRow > & mat,
const VecBase< T, N > & point )

Definition at line 1702 of file BLI_math_matrix.hh.

References abs(), N, project_point(), T, and blender::VecBase< T, Size >::VecBase().

◆ project_point() [4/4]

◆ project_point_safe() [1/4]

template float2 blender::math::project_point_safe ( const float3x3 & mat,
const float2 & point )
extern

References project_point_safe().

◆ project_point_safe() [2/4]

template float3 blender::math::project_point_safe ( const float4x4 & mat,
const float3 & point )
extern

References project_point_safe().

◆ project_point_safe() [3/4]

template<typename T, int N, int NumRow>
VecBase< T, N > blender::math::project_point_safe ( const MatBase< T, N+1, NumRow > & mat,
const VecBase< T, N > & point )

Definition at line 1711 of file BLI_math_matrix.hh.

References abs(), N, project_point_safe(), safe_divide(), and T.

◆ project_point_safe() [4/4]

template<typename MatT, typename VectorT>
VectorT blender::math::project_point_safe ( const MatT & mat,
const VectorT & point )
nodiscard

Safely project a point using a matrix (location & rotation & scale & perspective divide).

References project_point_safe().

Referenced by blender::nodes::node_fn_project_point_cc::node_build_multi_function(), project_point_safe(), project_point_safe(), project_point_safe(), and project_point_safe().

◆ pseudo_invert() [1/7]

template double2x2 blender::math::pseudo_invert ( const double2x2 & mat,
double epsilon )

References pseudo_invert().

◆ pseudo_invert() [2/7]

template double3x3 blender::math::pseudo_invert ( const double3x3 & mat,
double epsilon )

References pseudo_invert().

◆ pseudo_invert() [3/7]

template double4x4 blender::math::pseudo_invert ( const double4x4 & mat,
double epsilon )

References pseudo_invert().

◆ pseudo_invert() [4/7]

template float2x2 blender::math::pseudo_invert ( const float2x2 & mat,
float epsilon )

References pseudo_invert().

◆ pseudo_invert() [5/7]

template float3x3 blender::math::pseudo_invert ( const float3x3 & mat,
float epsilon )

References pseudo_invert().

◆ pseudo_invert() [6/7]

template float4x4 blender::math::pseudo_invert ( const float4x4 & mat,
float epsilon )

References pseudo_invert().

◆ pseudo_invert() [7/7]

template<typename T, int Size>
MatBase< T, Size, Size > blender::math::pseudo_invert ( const MatBase< T, Size, Size > & mat,
T epsilon = 1e-8 )
nodiscard

Compute Moore-Penrose pseudo inverse of matrix. Singular values below epsilon are ignored for stability (truncated SVD). Gives a good enough approximation of the regular inverse matrix if the given matrix is non-invertible (ex: degenerate transform). The returned pseudo inverse matrix A+ of input matrix A will not satisfy A+ * A = Identity but will satisfy A * A+ * A = A. For more detail, see https://en.wikipedia.org/wiki/Moore%E2%80%93Penrose_inverse.

Compute the Single Value Decomposition of an arbitrary matrix A That is compute the 3 matrices U,W,V with U column orthogonal (m,n) ,W a diagonal matrix and V an orthogonal square matrix s.t.A = U.W.Vt. From this decomposition it is trivial to compute the (pseudo-inverse) of A as Ainv = V.Winv.transpose(U).

WORKAROUND: (ComputeThinU | ComputeThinV) must be set as runtime parameters in Eigen < 3.4.0. But this requires the matrix type to be dynamic to avoid an assert.

Definition at line 223 of file math_matrix.cc.

References blender::MatBase< T, NumCol, NumRow, Alignment >::base_ptr(), from_scale(), invert(), pseudo_invert(), T, transpose(), blender::U, blender::unroll(), V, and W.

Referenced by blender::ed::transform::pointcloud::createTransPointCloudVerts(), blender::ed::transform::curves::curve_populate_trans_data_structs(), blender::median_dims_scale_matrix_calc(), pseudo_invert(), pseudo_invert(), pseudo_invert(), pseudo_invert(), pseudo_invert(), pseudo_invert(), pseudo_invert(), rotate(), and blender::tests::TEST().

◆ rcp() [1/2]

◆ rcp() [2/2]

template<typename T, int Size>
VecBase< T, Size > blender::math::rcp ( const VecBase< T, Size > & a)
inlinenodiscard

Per-element inverse. Zero elements are evaluated to NaN.

Definition at line 403 of file BLI_math_vector.hh.

References BLI_UNROLL_MATH_VEC_OP_VEC, and rcp().

◆ reduce_add()

◆ reduce_max()

◆ reduce_min()

◆ reduce_mul()

◆ reflect()

template<typename T, int Size>
VecBase< T, Size > blender::math::reflect ( const VecBase< T, Size > & incident,
const VecBase< T, Size > & normal )
inlinenodiscard

◆ refract()

template<typename T, int Size>
VecBase< T, Size > blender::math::refract ( const VecBase< T, Size > & incident,
const VecBase< T, Size > & normal,
const T & eta )
inlinenodiscard

◆ rotate() [1/6]

template<typename T, typename RotT, typename AngleT>
AxisAngleBase< T, AngleT > blender::math::rotate ( const AxisAngleBase< T, AngleT > & a,
const RotT & b )
nodiscard

Rotate a by b. In other word, insert the b rotation before a.

Note
Since a is an AxisAngle it will cast both a and b to Quaternion. This might introduce some precision loss and have performance implication.

Definition at line 206 of file BLI_math_rotation.hh.

References blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), b, and rotate().

◆ rotate() [2/6]

template<typename T, typename RotT>
Euler3Base< T > blender::math::rotate ( const Euler3Base< T > & a,
const RotT & b )
nodiscard

Rotate a by b. In other word, insert the b rotation before a.

Note
Since a is an Euler3 it will cast both a and b to MatBase<T, 3, 3>. This might introduce some precision loss and have performance implication.

Definition at line 219 of file BLI_math_rotation.hh.

References b, from_rotation(), blender::math::Euler3Base< T >::order(), rotate(), and to_euler().

◆ rotate() [3/6]

template<typename T, typename RotT>
EulerXYZBase< T > blender::math::rotate ( const EulerXYZBase< T > & a,
const RotT & b )
nodiscard

Rotate a by b. In other word, insert the b rotation before a.

Note
Since a is an EulerXYZ it will cast both a and b to MatBase<T, 3, 3>. This might introduce some precision loss and have performance implication.

Definition at line 212 of file BLI_math_rotation.hh.

References b, from_rotation(), rotate(), and to_euler().

◆ rotate() [4/6]

template<typename T, int NumCol, int NumRow, typename AngleT>
MatBase< T, NumCol, NumRow > blender::math::rotate ( const MatBase< T, NumCol, NumRow > & mat,
const AxisAngleBase< T, AngleT > & rotation )
nodiscard

Definition at line 688 of file BLI_math_matrix.hh.

References cos(), from_rotation(), blender::result, rotate(), sin(), T, and unroll.

◆ rotate() [5/6]

template<typename T, int NumCol, int NumRow, typename RotationT>
MatBase< T, NumCol, NumRow > blender::math::rotate ( const MatBase< T, NumCol, NumRow > & mat,
const RotationT & rotation )
nodiscard

◆ rotate() [6/6]

template<typename T, typename RotT>
QuaternionBase< T > blender::math::rotate ( const QuaternionBase< T > & a,
const RotT & b )
nodiscard

Rotate a by b. In other word, insert the b rotation before a.

Note
Since a is a Quaternion it will cast b to a Quaternion. This might introduce some precision loss and have performance implication.

Definition at line 200 of file BLI_math_rotation.hh.

References b, blender::math::QuaternionBase< T >::QuaternionBase(), and rotate().

◆ rotate_around_axis()

float3 blender::math::rotate_around_axis ( const float3 & vector,
const float3 & center,
const float3 & axis,
float angle )

Rotate any arbitrary vector around the center position, with a unit-length axis and the specified angle.

Definition at line 131 of file math_rotation.cc.

References angle(), blender::axis_angle_normalized_to_mat3(), blender::mul_m3_v3(), blender::result, and rotate_around_axis().

Referenced by blender::ed::sculpt_paint::boundary::calc_twist_position(), and rotate_around_axis().

◆ rotate_around_point_2d()

float2 blender::math::rotate_around_point_2d ( const float2 p,
const float2 pivot,
const AngleRadian angle )
inline

Definition at line 188 of file BLI_math_rotation.hh.

References angle(), from_rotation(), and rotate_around_point_2d().

Referenced by rotate_around_point_2d().

◆ rotate_direction_around_axis()

◆ rotation_between() [1/3]

CartesianBasis blender::math::rotation_between ( const AxisSigned a_forward,
const AxisSigned b_forward )
inlinenodiscard

Create an CartesianBasis for converting from an a orientation defined only by its forward vector to a b orientation defined only by its forward vector. Rotation is given to be non flipped and deterministic.

Definition at line 430 of file BLI_math_basis_types.hh.

References abs(), from_orthonormal_axes(), blender::math::AxisSigned::next_after(), rotation_between(), and sign().

◆ rotation_between() [2/3]

◆ rotation_between() [3/3]

template<typename T>
QuaternionBase< T > blender::math::rotation_between ( const QuaternionBase< T > & a,
const QuaternionBase< T > & b )
nodiscard

Return rotation from orientation a to orientation b into another quaternion.

Definition at line 227 of file BLI_math_rotation.hh.

References b, invert(), and rotation_between().

◆ round() [1/2]

template<typename T>
T blender::math::round ( const T & a)
inline

Definition at line 117 of file BLI_math_base.hh.

References round(), and T.

Referenced by blender::seq::apply_text_alignment(), blender::geometry::assign_samples_to_segments(), blender::ed::sculpt_paint::greasepencil::brush_point_influence_mask(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::compute_piecewise_linear_falloff(), blender::bke::attribute_math::detail::double2_to_int2(), blender::seq::final_image_cache_get(), blender::seq::final_image_cache_put(), blender::bke::attribute_math::detail::float2_to_short2(), blender::get_build_factor(), blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::init_auto_masking(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::intersections_segment_circle_integers(), blender::jpeg_density_from_ppm(), blender::ed::space_node::mark_sockets_collapsed_recursive(), blender::nodes::gizmos::node_input_from_rect(), blender::ed::transform::node_snap_grid_apply(), blender::ed::space_node::node_update_basis(), blender::ed::space_node::node_update_basis_buttons(), blender::ed::space_node::node_update_basis_from_declaration(), blender::ed::space_node::node_update_collapsed(), blender::draw::detail::pack_gaussian(), blender::draw::detail::pack_radiance(), round(), round(), blender::compositor::SMAAArea(), blender::compositor::SMAABlendingWeightCalculationPS(), blender::compositor::SMAADecodeDiagBilinearAccess(), blender::compositor::SMAADecodeDiagBilinearAccess(), blender::ed::transform::snap_grid(), blender::seq::source_image_cache_get(), blender::seq::source_image_cache_put(), blender::store_pixel(), blender::seq::thumbnail_cache_get(), and blender::uv_copy_mirrored_faces().

◆ round() [2/2]

template<typename T, int Size>
VecBase< T, Size > blender::math::round ( const VecBase< T, Size > & a)
inlinenodiscard

Definition at line 364 of file BLI_math_vector.hh.

References BLI_UNROLL_MATH_VEC_OP_VEC, and round().

◆ safe_acos()

template<typename T>
T blender::math::safe_acos ( const T & a)
inline

◆ safe_acos_approx()

◆ safe_divide() [1/3]

template<typename T>
T blender::math::safe_divide ( const T & a,
const T & b )
inline

Definition at line 107 of file BLI_math_base.hh.

References b, safe_divide(), and T.

Referenced by blender::nodes::node_composite_alpha_over_cc::alpha_over_conjoint(), blender::nodes::node_composite_alpha_over_cc::alpha_over_disjoint(), blender::apply_gradient_tint(), blender::ed::sculpt_paint::smooth::average_data_bmesh(), blender::ed::sculpt_paint::smooth::average_data_grids(), blender::ed::sculpt_paint::average_mask_border_position(), blender::ed::sculpt_paint::average_unmasked_position(), blender::geometry::build_point_to_sample_map(), blender::nodes::node_shader_map_range_cc::build_vector_linear(), blender::nodes::node_shader_map_range_cc::build_vector_stepped(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_mesh(), blender::ed::sculpt_paint::calc_vertex_displacement(), blender::ed::space_node::calculate_inner_link_bezier_points(), blender::xpbd::closest_on_segment_to_ray(), blender::deform_drawing(), blender::nodes::node_composite_difference_key_cc::difference_matte(), blender::nodes::node_composite_distance_key_cc::distance_key(), blender::ed::sculpt_paint::ScaleCurvesEffect::execute(), blender::nodes::node_composite_bokeh_blur_cc::BokehBlurOperation::execute_constant_size_cpu(), blender::nodes::node_composite_defocus_cc::DefocusOperation::execute_cpu(), blender::nodes::node_composite_blur_cc::BlurOperation::execute_variable_size_cpu(), blender::nodes::node_composite_bokeh_blur_cc::BokehBlurOperation::execute_variable_size_cpu(), blender::ed::greasepencil::fit_strokes_to_view(), blender::ed::greasepencil::segment::get_intersection_distance_of_segments(), blender::nodes::node_composite_glare_cc::GlareOperation::get_sample_position(), blender::geometry::limit_radius(), blender::ed::sculpt_paint::move_last_point_and_resample(), blender::ed::sculpt_paint::smooth::neighbor_color_average(), blender::nodes::node_fn_integer_math_cc::node_eval_inverse(), blender::nodes::node_shader_math_cc::node_eval_inverse(), blender::nodes::node_shader_vector_math_cc::node_eval_inverse(), blender::openexr_header_metadata_pixelinfo(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_projected(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_spherical(), blender::ed::greasepencil::pixel_radius_to_world_space_radius(), blender::ed::sculpt_paint::project_brush_radius_grease_pencil(), project_point_safe(), blender::fn::multi_function::register_common_functions_impl(), safe_divide(), safe_divide(), safe_divide(), blender::length_parameterize::sample_at_length(), blender::geometry::sample_curve_padded(), blender::nodes::node_shader_map_range_cc::sh_node_map_range_build_multi_function(), blender::stretchto_evaluate(), blender::compositor::SymmetricBlurWeights::SymmetricBlurWeights(), blender::view3d_panel_curve_data(), blender::wm_xr_navigation_teleport_arc_clip_to_ground(), and blender::zspan_rasterize_conservative_line().

◆ safe_divide() [2/3]

template<typename T, int Size>
VecBase< T, Size > blender::math::safe_divide ( const VecBase< T, Size > & a,
const T & b )
inlinenodiscard

Returns 0 if denominator is exactly equal to 0.

Definition at line 352 of file BLI_math_vector.hh.

References b, safe_divide(), T, and blender::VecBase< T, Size >::VecBase().

◆ safe_divide() [3/3]

template<typename T, int Size>
VecBase< T, Size > blender::math::safe_divide ( const VecBase< T, Size > & a,
const VecBase< T, Size > & b )
inlinenodiscard

Returns 0 if denominator is exactly equal to 0.

Definition at line 342 of file BLI_math_vector.hh.

References b, BLI_UNROLL_MATH_VEC_FUNC_VEC_VEC, and safe_divide().

◆ safe_floored_mod()

template<typename T>
T blender::math::safe_floored_mod ( const T & a,
const T & b )
inline

Definition at line 94 of file BLI_math_base.hh.

References b, safe_floored_mod(), and T.

Referenced by safe_floored_mod().

◆ safe_mod() [1/3]

template<typename T>
T blender::math::safe_mod ( const T & a,
const T & b )
inline

◆ safe_mod() [2/3]

template<typename T, int Size>
VecBase< T, Size > blender::math::safe_mod ( const VecBase< T, Size > & a,
const T & b )
inlinenodiscard

Safe version of mod(a, b) that returns 0 if b is equal to 0.

Definition at line 188 of file BLI_math_vector.hh.

References b, mod(), blender::result, safe_mod(), T, and blender::VecBase< T, Size >::VecBase().

◆ safe_mod() [3/3]

template<typename T, int Size>
VecBase< T, Size > blender::math::safe_mod ( const VecBase< T, Size > & a,
const VecBase< T, Size > & b )
inlinenodiscard

Safe version of mod(a, b) that returns 0 if b is equal to 0.

Definition at line 178 of file BLI_math_vector.hh.

References b, BLI_UNROLL_MATH_VEC_FUNC_VEC_VEC, and safe_mod().

◆ safe_pow() [1/2]

template<typename T>
T blender::math::safe_pow ( const T & x,
const T & power )
inline

◆ safe_pow() [2/2]

template<typename T, int Size>
VecBase< T, Size > blender::math::safe_pow ( const VecBase< T, Size > & x,
const T & y )
inlinenodiscard

Return the value of x raised to the y power. The result is x if x < 0 or if x = 0 and y <= 0.

Definition at line 242 of file BLI_math_vector.hh.

References blender::result, safe_pow(), T, blender::x, and y.

◆ safe_rcp() [1/2]

template<typename T>
T blender::math::safe_rcp ( const T & a)
inline

Definition at line 168 of file BLI_math_base.hh.

References safe_rcp(), and T.

Referenced by blender::ed::sculpt_paint::smooth::average_positions(), blender::ed::sculpt_paint::boundary::calc_average_position(), blender::ed::sculpt_paint::boundary::calc_average_position(), blender::ed::sculpt_paint::calc_brush_cube_distances(), blender::ed::sculpt_paint::CombOperationExecutor::comb_projected(), blender::ed::sculpt_paint::CombOperationExecutor::comb_spherical(), blender::nodes::node_geo_uv_tangent_cc::compute_triangle_tangent(), blender::ed::greasepencil::image_render::draw_dots(), blender::draw::drw_volume_object_mesh_init(), blender::draw::overlay::MeshUVs::end_sync(), blender::xpbd::evaluate_align_rotations_constraint(), blender::xpbd::evaluate_rod_stretch_and_shear_constraint(), blender::ed::greasepencil::fit_strokes_to_view(), blender::bke::greasepencil::convert::get_legacy_stroke_to_texture_matrix(), blender::nodes::node_composite_glare_cc::GlareOperation::karis_brightness_weighted_sum(), blender::ed::sculpt_paint::filter::mesh_filter_sharpen_init(), blender::bke::attribute_math::mix_indices(), blender::bke::attribute_math::mix_indices(), blender::bke::attribute_math::mix_indices(), blender::bke::attribute_math::mix_indices(), safe_rcp(), safe_rcp(), blender::bke::greasepencil::Drawing::set_texture_matrices(), blender::tests::TEST(), blender::seq::WipeData::WipeData(), blender::write_fill_transforms(), blender::write_stroke_transforms(), and blender::nodes::node_geo_xpbd_solver_cc::XpbdSolverStep::XpbdSolverStep().

◆ safe_rcp() [2/2]

template<typename T, int Size>
VecBase< T, Size > blender::math::safe_rcp ( const VecBase< T, Size > & a)
inlinenodiscard

Per-element inverse. Zero elements are evaluated to zero.

Definition at line 413 of file BLI_math_vector.hh.

References BLI_UNROLL_MATH_VEC_OP_VEC, and safe_rcp().

◆ safe_sqrt()

template<typename T, int Size>
VecBase< T, Size > blender::math::safe_sqrt ( const VecBase< T, Size > & a)
inlinenodiscard

Per-element square root. Negative elements are evaluated to zero.

Definition at line 390 of file BLI_math_vector.hh.

References blender::result, safe_sqrt(), and T.

Referenced by safe_sqrt(), and blender::tests::TEST().

◆ scale()

template<typename T, int NumCol, int NumRow, typename VectorT>
MatBase< T, NumCol, NumRow > blender::math::scale ( const MatBase< T, NumCol, NumRow > & mat,
const VectorT & scale )
nodiscard

◆ sign() [1/3]

int blender::math::sign ( const AxisSigned & axis)
inlinenodiscard

Definition at line 206 of file BLI_math_basis_types.hh.

References blender::math::AxisSigned::sign(), and sign().

◆ sign() [2/3]

◆ sign() [3/3]

template<typename T, int Size>
VecBase< T, Size > blender::math::sign ( const VecBase< T, Size > & a)
inlinenodiscard

Returns -1 if a is less than 0, 0 if a is equal to 0, and +1 if a is greater than 0.

Definition at line 51 of file BLI_math_vector.hh.

References BLI_UNROLL_MATH_VEC_OP_VEC, and sign().

◆ sin() [1/4]

template<typename T>
T blender::math::sin ( const AngleCartesianBase< T > & a)

Definition at line 701 of file BLI_math_angle_types.hh.

References blender::math::AngleCartesianBase< T >::sin(), sin(), and T.

◆ sin() [2/4]

template<typename T>
T blender::math::sin ( const AngleFraction< T > & a)

Definition at line 714 of file BLI_math_angle_types.hh.

References sin(), and T.

◆ sin() [3/4]

template<typename T>
T blender::math::sin ( const AngleRadianBase< T > & a)

Definition at line 688 of file BLI_math_angle_types.hh.

References blender::math::AngleRadianBase< T >::radian(), sin(), and T.

Referenced by blender::math::AngleRadianBase< float >::AngleRadianBase(), blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), blender::noise::compute_2d_gabor_kernel(), blender::noise::compute_3d_gabor_kernel(), blender::noise::compute_3d_orientation(), blender::compositor::compute_numerator_1(), blender::compositor::compute_numerator_2(), blender::compositor::compute_numerator_3(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_streak_direction(), blender::bke::tests::GreasePencilInterpolate::create_test_shape(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic_cpu(), blender::nodes::node_composite_box_mask_cc::BoxMaskOperation::execute_cpu(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::execute_cpu(), blender::nodes::node_composite_ellipse_mask_cc::EllipseMaskOperation::execute_cpu(), blender::nodes::node_composite_split_cc::SplitOperation::execute_cpu(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::execute_gpu(), blender::nodes::node_composite_split_cc::SplitOperation::execute_gpu(), blender::geometry::profile::find_even_superellipse_chords(), blender::math::detail::from_rotation(), blender::math::detail::from_rotation(), blender::math::detail::from_rotation(), from_triangle(), blender::ed::greasepencil::generate_arc_from_point_to_point(), blender::ed::greasepencil::generate_circle_from_point(), blender::get_rand_matrix(), blender::compositor::get_regular_polygon_vertex_position(), blender::ed::greasepencil::grease_pencil_primitive_rotate_all_update(), interpolate_dot_slerp(), blender::workbench::SceneResources::load_jitter_tx(), blender::math::AngleFraction< T >::operator AngleCartesianBase< T >(), pow(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), blender::draw::overlay::ring_vertices(), rotate(), blender::ed::sculpt_paint::greasepencil::rotate_by_angle(), blender::rotate_by_angle(), sin(), sin(), sin(), sin(), blender::math::tests::TEST(), to_quaternion(), to_quaternion(), to_quaternion_legacy(), blender::write_fill_transforms(), blender::io::grease_pencil::PDFExporter::write_path(), blender::io::grease_pencil::write_stroke_color_attribute(), and blender::write_weights_for_drawing().

◆ sin() [4/4]

template<typename T>
T blender::math::sin ( const T & a)
inline

Definition at line 179 of file BLI_math_base.hh.

References sin(), and T.

◆ skip_transform()

bool blender::math::skip_transform ( const float4x4 & transform)
static

◆ sqrt() [1/2]

template<typename T>
T blender::math::sqrt ( const T & a)
inline

Definition at line 153 of file BLI_math_base.hh.

References sqrt(), and T.

Referenced by blender::ed::sculpt_paint::greasepencil::brush_point_influence_mask(), blender::geometry::construct::build_boundary_terminal_edge(), blender::bke::build_point_matrix_miter_scale(), blender::calc_min_radius_v3v3(), blender::ed::sculpt_paint::pose::calc_squash_stretch_deform(), blender::calculate_circle_inside_fit(), blender::noise::compute_2d_gabor_standard_deviation(), blender::noise::compute_3d_gabor_standard_deviation(), blender::nodes::node_composite_lens_distortion_cc::compute_chromatic_distortion_scale(), blender::nodes::node_composite_lens_distortion_cc::compute_distortion_scale(), blender::nodes::node_composite_lens_distortion_cc::compute_number_of_integration_steps_heuristic(), blender::nodes::node_composite_levels_cc::LevelsOperation::compute_standard_deviation(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic_cpu(), blender::nodes::node_composite_despeckle_cc::DespeckleOperation::execute_cpu(), blender::nodes::node_composite_filter_cc::FilterOperation::execute_cpu(), blender::geometry::profile::find_even_superellipse_chords_general(), blender::geometry::profile::find_superellipse_chord_endpoint(), blender::math::AngleCartesianBase< float >::from_point(), blender::nodes::node_geo_field_variance_cc::FieldVarianceInput::get_varray_for_context(), blender::hook_falloff(), blender::geometry::BevelState::initialize_profile_data(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::intersections_segment_circle_integers(), length(), blender::multires_reshape_store_original_grids(), normalize(), normalize_and_get_length(), normalize_and_get_length(), blender::math::detail::normalized_to_quat_fast(), blender::math::AngleCartesianBase< float >::operator/, refract(), blender::compositor::SMAABlendingWeightCalculationPS(), blender::compositor::SMAANeighborhoodBlendingPS(), blender::ed::transform::snap_object_project_view3d_ex(), sqrt(), sqrt(), blender::tests::TEST(), and blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_scale_transform_and_target_property().

◆ sqrt() [2/2]

template<typename T, int Size>
VecBase< T, Size > blender::math::sqrt ( const VecBase< T, Size > & a)
inlinenodiscard

Per-element square root. Negative elements are evaluated to NaN.

Definition at line 380 of file BLI_math_vector.hh.

References BLI_UNROLL_MATH_VEC_OP_VEC, and sqrt().

◆ square() [1/2]

template<typename T>
T blender::math::square ( const T & a)
inline

Definition at line 209 of file BLI_math_base.hh.

References square(), and T.

Referenced by blender::BKE_light_area(), blender::BKE_mball_polygonize(), blender::bmesh_find_doubles_by_distance_connected_impl(), blender::bone_envelope_falloff(), blender::ed::sculpt_paint::cloth::brush_affected_nodes_gather(), blender::ed::sculpt_paint::filter::cache_init(), blender::ed::sculpt_paint::calc_brush_node_mask(), blender::ed::sculpt_paint::brushes::clay_strips::calc_node_mask(), blender::calculate_verts(), blender::compositor::compute_fog_glow_kernel_value(), blender::nodes::node_composite_corner_pin_cc::CornerPinOperation::compute_plane_cpu(), blender::nodes::node_composite_plane_track_deform_cc::PlaneTrackDeformOperation::compute_plane_cpu(), blender::compositor::compute_scaled_poles_variance_derivative(), blender::ed_tracking_pick_plane_track(), blender::ed_tracking_pick_point_track(), blender::xpbd::evaluate_distance_constraint(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic_cpu(), blender::execute_curve_chain(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_sun_beams_cpu(), blender::compositor::find_scale_factor(), from_up_axis(), blender::get_space_input_chains(), blender::compositor::morphological_distance_cpu(), blender::nodes::node_geo_grid_solve_poisson_cc::node_geo_exec(), blender::ed::sculpt_paint::pbvh_gather_generic(), blender::KDTreeNew< T >::search(), blender::xpbd::CollisionEdgeConstraintSet::solve_single(), blender::xpbd::CollisionFaceConstraintSet::solve_single(), square(), square(), blender::compositor::sum_squared_difference_color_cpu(), blender::tests::TEST(), to_dual_quaternion(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_scale_transform_and_target_property(), and blender::uv_remove_doubles_to_selected_shared_vertex().

◆ square() [2/2]

template<typename T, int Size>
VecBase< T, Size > blender::math::square ( const VecBase< T, Size > & a)
inlinenodiscard

Per-element square.

Definition at line 279 of file BLI_math_vector.hh.

References BLI_UNROLL_MATH_VEC_OP_VEC, and square().

◆ step() [1/3]

◆ step() [2/3]

template<typename T, int Size>
VecBase< T, Size > blender::math::step ( const T & edge,
const VecBase< T, Size > & value )
inlinenodiscard

Definition at line 148 of file BLI_math_vector.hh.

References blender::result, step(), and T.

◆ step() [3/3]

template<typename T, int Size>
VecBase< T, Size > blender::math::step ( const VecBase< T, Size > & edge,
const VecBase< T, Size > & value )
inlinenodiscard

Definition at line 141 of file BLI_math_vector.hh.

References BLI_UNROLL_MATH_VEC_FUNC_VEC_VEC, and step().

◆ tan() [1/4]

template<typename T>
T blender::math::tan ( const AngleCartesianBase< T > & a)

Definition at line 705 of file BLI_math_angle_types.hh.

References T, blender::math::AngleCartesianBase< T >::tan(), and tan().

◆ tan() [2/4]

template<typename T>
T blender::math::tan ( const AngleFraction< T > & a)

Definition at line 718 of file BLI_math_angle_types.hh.

References T, and tan().

◆ tan() [3/4]

◆ tan() [4/4]

template<typename T>
T blender::math::tan ( const T & a)
inline

Definition at line 184 of file BLI_math_base.hh.

References T, and tan().

◆ TEST() [1/25]

◆ TEST() [2/25]

blender::math::TEST ( math_geom_hh ,
AreaTri  )

◆ TEST() [3/25]

blender::math::TEST ( math_geom_hh ,
AxisDominantToM3  )

◆ TEST() [4/25]

blender::math::TEST ( math_geom_hh ,
BarycentricWeights  )

◆ TEST() [5/25]

blender::math::TEST ( math_geom_hh ,
ClosestToLineSegment3D  )

◆ TEST() [6/25]

blender::math::TEST ( math_geom_hh ,
ClosestToPlane  )

◆ TEST() [7/25]

blender::math::TEST ( math_geom_hh ,
ClosestToPlaneNormalized  )

◆ TEST() [8/25]

blender::math::TEST ( math_geom_hh ,
CotangentTriWeight  )

◆ TEST() [9/25]

blender::math::TEST ( math_geom_hh ,
DistSquaredToLineSegment2D  )

◆ TEST() [10/25]

blender::math::TEST ( math_geom_hh ,
DistSquaredToLineSegment3D  )

◆ TEST() [11/25]

blender::math::TEST ( math_geom_hh ,
DistSquaredToPlane  )

◆ TEST() [12/25]

blender::math::TEST ( math_geom_hh ,
InterpBilinearQuad  )

◆ TEST() [13/25]

◆ TEST() [14/25]

blender::math::TEST ( math_geom_hh ,
IsectLineLine3D  )

◆ TEST() [15/25]

blender::math::TEST ( math_geom_hh ,
IsectLinePlane  )

Definition at line 260 of file BLI_math_geom_hh_test.cc.

References EXPECT_FALSE, EXPECT_NEAR, isect_line_plane(), and TEST().

◆ TEST() [16/25]

◆ TEST() [17/25]

blender::math::TEST ( math_geom_hh ,
IsectPointQuad2D  )

◆ TEST() [18/25]

blender::math::TEST ( math_geom_hh ,
IsectPointTri2D  )

Definition at line 276 of file BLI_math_geom_hh_test.cc.

References blender::EXPECT_EQ(), isect_point_tri(), TEST(), and blender::v2.

◆ TEST() [19/25]

blender::math::TEST ( math_geom_hh ,
LinePointFactor2D  )

◆ TEST() [20/25]

blender::math::TEST ( math_geom_hh ,
LinePointFactor3D  )

◆ TEST() [21/25]

blender::math::TEST ( math_geom_hh ,
MapToSphere  )

◆ TEST() [22/25]

blender::math::TEST ( math_geom_hh ,
NormalQuad  )

◆ TEST() [23/25]

blender::math::TEST ( math_geom_hh ,
PlaneFromPointNormal  )

◆ TEST() [24/25]

blender::math::TEST ( math_geom_hh ,
PlanePointSide  )

◆ TEST() [25/25]

blender::math::TEST ( math_geom_hh ,
PolyToTriCount  )

◆ to_angle()

template<typename T>
AngleRadianBase< T > blender::math::to_angle ( const MatBase< T, 2, 2 > & mat)
inlinenodiscard

Extract euler rotation from transform matrix.

Returns
the rotation with the smallest values from the potential candidates.

Definition at line 1190 of file BLI_math_matrix.hh.

References blender::math::detail::normalized_to_angle(), and to_angle().

Referenced by rotate(), to_angle(), and blender::math::detail::to_rotation().

◆ to_axis_angle() [1/6]

template AxisAngle blender::math::to_axis_angle ( const Euler3 & )
extern

References to_axis_angle().

◆ to_axis_angle() [2/6]

template<typename T, typename AngleT = AngleRadian>
AxisAngleBase< T, AngleT > blender::math::to_axis_angle ( const Euler3Base< T > & euler)

Definition at line 106 of file BLI_math_euler.hh.

References to_axis_angle(), and to_quaternion().

◆ to_axis_angle() [3/6]

template AxisAngle blender::math::to_axis_angle ( const EulerXYZ & )
extern

References to_axis_angle().

◆ to_axis_angle() [4/6]

◆ to_axis_angle() [5/6]

template AxisAngle blender::math::to_axis_angle ( const Quaternion & )
extern

References to_axis_angle().

◆ to_axis_angle() [6/6]

◆ to_dual_quaternion()

template<typename T>
DualQuaternionBase< T > blender::math::to_dual_quaternion ( const MatBase< T, 4, 4 > & mat,
const MatBase< T, 4, 4 > & basemat )
nodiscard

Convert transformation mat with parent transform basemat into a dual-quaternion representation.

This allows volume preserving deformation for skinning.

Conversion routines between (regular quaternion, translation) and dual quaternion.

Version 1.0.0, February 7th, 2007

SPDX-License-Identifier: Zlib Copyright 2006-2007 University of Dublin, Trinity College, All Rights Reserved.

Changes for Blender:

  • renaming, style changes and optimizations
  • added support for scaling

Definition at line 554 of file BLI_math_quaternion.hh.

References blender::math::DualQuaternionBase< T >::DualQuaternionBase(), from_rotation(), invert(), is_negative(), is_orthonormal(), length_squared(), normalize(), orthogonalize(), R, scale(), square(), T, to_dual_quaternion(), to_quaternion(), to_scale(), blender::math::QuaternionBase< T >::w, blender::math::QuaternionBase< T >::x, blender::math::Axis::Y, blender::math::QuaternionBase< T >::y, and blender::math::QuaternionBase< T >::z.

Referenced by blender::math::tests::TEST(), and to_dual_quaternion().

◆ to_euler() [1/14]

template EulerXYZ blender::math::to_euler ( const AxisAngle & )
extern

References to_euler().

◆ to_euler() [2/14]

template Euler3 blender::math::to_euler ( const AxisAngle & ,
EulerOrder  )
extern

References to_euler().

◆ to_euler() [3/14]

template<typename T, typename AngleT>
EulerXYZBase< T > blender::math::to_euler ( const AxisAngleBase< T, AngleT > & axis_angle)

◆ to_euler() [4/14]

◆ to_euler() [5/14]

template EulerXYZ blender::math::to_euler ( const AxisAngleCartesian & )
extern

References to_euler().

◆ to_euler() [6/14]

template Euler3 blender::math::to_euler ( const AxisAngleCartesian & ,
EulerOrder  )
extern

References to_euler().

◆ to_euler() [7/14]

template<typename T>
EulerXYZBase< T > blender::math::to_euler ( const MatBase< T, 3, 3 > & mat)
inlinenodiscard

◆ to_euler() [8/14]

template<typename T>
Euler3Base< T > blender::math::to_euler ( const MatBase< T, 3, 3 > & mat,
EulerOrder order )
inlinenodiscard

◆ to_euler() [9/14]

template<typename T>
EulerXYZBase< T > blender::math::to_euler ( const MatBase< T, 4, 4 > & mat)
inlinenodiscard

Definition at line 1221 of file BLI_math_matrix.hh.

References to_euler().

◆ to_euler() [10/14]

template<typename T>
Euler3Base< T > blender::math::to_euler ( const MatBase< T, 4, 4 > & mat,
EulerOrder order )
inlinenodiscard

Definition at line 1215 of file BLI_math_matrix.hh.

References to_euler().

◆ to_euler() [11/14]

template EulerXYZ blender::math::to_euler ( const Quaternion & )
extern

References to_euler().

◆ to_euler() [12/14]

template Euler3 blender::math::to_euler ( const Quaternion & ,
EulerOrder  )
extern

References to_euler().

◆ to_euler() [13/14]

template<typename T>
EulerXYZBase< T > blender::math::to_euler ( const QuaternionBase< T > & quat)

◆ to_euler() [14/14]

template<typename T>
Euler3Base< T > blender::math::to_euler ( const QuaternionBase< T > & quat,
EulerOrder order )

◆ to_gimbal_axis()

template<typename T>
MatBase< T, 3, 3 > blender::math::to_gimbal_axis ( const Euler3Base< T > & rotation)
nodiscard

Convert euler rotation to gimbal rotation matrix.

Definition at line 368 of file BLI_math_rotation.hh.

References from_rotation(), blender::math::Euler3Base< T >::i(), blender::result, T, and to_gimbal_axis().

Referenced by blender::math::tests::TEST(), and to_gimbal_axis().

◆ to_loc_rot_scale() [1/2]

template<bool AllowNegativeScale = false, typename T>
void blender::math::to_loc_rot_scale ( const MatBase< T, 3, 3 > & mat,
VecBase< T, 2 > & r_location,
AngleRadianBase< T > & r_rotation,
VecBase< T, 2 > & r_scale )
inline

◆ to_loc_rot_scale() [2/2]

template<bool AllowNegativeScale = false, typename T, typename RotationT>
void blender::math::to_loc_rot_scale ( const MatBase< T, 4, 4 > & mat,
VecBase< T, 3 > & r_location,
RotationT & r_rotation,
VecBase< T, 3 > & r_scale )
inline

◆ to_loc_rot_scale_safe()

template<bool AllowNegativeScale, typename T, typename RotationT>
void blender::math::to_loc_rot_scale_safe ( const MatBase< T, 4, 4 > & mat,
VecBase< T, 3 > & r_location,
RotationT & r_rotation,
VecBase< T, 3 > & r_scale )
inline

◆ to_nearest_euler() [1/4]

template<typename T>
Euler3Base< T > blender::math::to_nearest_euler ( const MatBase< T, 3, 3 > & mat,
const Euler3Base< T > & reference )
inlinenodiscard

◆ to_nearest_euler() [2/4]

template<typename T>
EulerXYZBase< T > blender::math::to_nearest_euler ( const MatBase< T, 3, 3 > & mat,
const EulerXYZBase< T > & reference )
inlinenodiscard

Extract euler rotation from transform matrix. The returned euler triple is given to be the closest from the reference. It avoids axis flipping for animated f-curves for eg.

Returns
the rotation with the smallest values from the potential candidates.
Note
this correspond to the C API "to_compatible" functions.

Definition at line 1243 of file BLI_math_matrix.hh.

References length_manhattan(), blender::math::detail::normalized_to_eul2(), to_nearest_euler(), and blender::math::EulerXYZBase< T >::wrapped_around().

Referenced by rotate(), blender::tests::TEST(), to_nearest_euler(), to_nearest_euler(), to_nearest_euler(), and to_nearest_euler().

◆ to_nearest_euler() [3/4]

template<typename T>
Euler3Base< T > blender::math::to_nearest_euler ( const MatBase< T, 4, 4 > & mat,
const Euler3Base< T > & reference )
inlinenodiscard

Definition at line 1258 of file BLI_math_matrix.hh.

References to_euler(), and to_nearest_euler().

◆ to_nearest_euler() [4/4]

template<typename T>
EulerXYZBase< T > blender::math::to_nearest_euler ( const MatBase< T, 4, 4 > & mat,
const EulerXYZBase< T > & reference )
inlinenodiscard

Definition at line 1266 of file BLI_math_matrix.hh.

References to_euler(), and to_nearest_euler().

◆ to_quaternion() [1/10]

template Quaternion blender::math::to_quaternion ( const AxisAngle & )
extern

References to_quaternion().

◆ to_quaternion() [2/10]

template<typename T, typename AngleT>
QuaternionBase< T > blender::math::to_quaternion ( const AxisAngleBase< T, AngleT > & axis_angle)

Definition at line 71 of file BLI_math_axis_angle.hh.

References blender::math::AxisAngleBase< T, AngleT >::angle(), blender::math::AxisAngleBase< T, AngleT >::axis(), blender::BLI_assert(), cos(), is_unit_scale(), blender::math::QuaternionBase< T >::QuaternionBase(), sin(), T, and to_quaternion().

Referenced by blender::nodes::node_fn_align_rotation_to_vector_cc::align_rotations_auto_pivot(), blender::nodes::node_fn_align_rotation_to_vector_cc::align_rotations_fixed_pivot(), blender::ed::sculpt_paint::brush_delta_update(), blender::nodes::node_fn_axes_to_rotation_cc::AxesToRotationFunction::call(), blender::nodes::node_geo_mesh_primitive_cube_cc::create_cube_mesh(), blender::io::usd::USDPointInstancerWriter::do_write(), blender::compositor::SingleValueNodeInputOperation::execute(), blender::math::QuaternionBase< T >::expmap(), blender::geometry::extend_curve_curved(), blender::bke::float2_to_quaternion(), blender::bke::float3_to_quaternion(), blender::bke::float_to_quaternion(), from_vector(), blender::compositor::get_effect_input(), blender::compositor::get_input_value_link(), blender::nodes::init_socket_cpp_value(), interpolate(), blender::make_socket_type_rotation(), blender::bke::attribute_math::mix4(), blender::nodes::node_fn_axis_angle_to_rotation_cc::node_build_multi_function(), blender::nodes::node_fn_euler_to_rotation_cc::node_build_multi_function(), blender::nodes::node_fn_input_rotation_cc::node_build_multi_function(), blender::nodes::node_fn_rotation_to_axis_angle_cc::node_eval_inverse(), blender::nodes::node_fn_rotation_to_euler_cc::node_eval_inverse(), blender::nodes::node_geo_tool_3d_cursor_cc::node_geo_exec(), normalized_to_quaternion_safe(), rotate(), blender::seq::set_single_input_from_rna_value(), blender::math::tests::TEST(), to_axis_angle(), to_axis_angle(), to_dual_quaternion(), to_euler(), to_euler(), to_loc_rot_scale_safe(), to_quaternion(), to_quaternion(), to_quaternion(), to_quaternion(), to_quaternion(), to_quaternion(), to_quaternion(), to_quaternion(), to_quaternion(), to_quaternion(), and blender::math::detail::to_rotation().

◆ to_quaternion() [3/10]

template Quaternion blender::math::to_quaternion ( const AxisAngleCartesian & )
extern

References to_quaternion().

◆ to_quaternion() [4/10]

template<typename T>
QuaternionBase< T > blender::math::to_quaternion ( const CartesianBasis & rotation)

Creates a quaternion from an axis triple. This is faster and more precise than converting from another representation.

There are only 6 * 4 = 24 possible valid orthonormal orientations. We precompute them and store them inside this switch using a key. Generated using generate_axes_to_quaternion_switch_cases().

Definition at line 400 of file BLI_math_rotation.hh.

References blender::math::QuaternionBase< T >::identity(), rcp(), T, to_quaternion(), blender::x, blender::math::AxisSigned::X_NEG, blender::math::AxisSigned::X_POS, y, blender::math::AxisSigned::Y_NEG, blender::math::AxisSigned::Y_POS, z(), blender::math::AxisSigned::Z_NEG, and blender::math::AxisSigned::Z_POS.

◆ to_quaternion() [5/10]

template Quaternion blender::math::to_quaternion ( const Euler3 & )
extern

References to_quaternion().

◆ to_quaternion() [6/10]

◆ to_quaternion() [7/10]

template Quaternion blender::math::to_quaternion ( const EulerXYZ & )
extern

References to_quaternion().

◆ to_quaternion() [8/10]

◆ to_quaternion() [9/10]

template<typename T>
QuaternionBase< T > blender::math::to_quaternion ( const MatBase< T, 3, 3 > & mat)
inlinenodiscard

Extract quaternion rotation from transform matrix.

Definition at line 1274 of file BLI_math_matrix.hh.

References blender::math::detail::normalized_to_quat_with_checks(), and to_quaternion().

◆ to_quaternion() [10/10]

template<typename T>
QuaternionBase< T > blender::math::to_quaternion ( const MatBase< T, 4, 4 > & mat)
inlinenodiscard

Definition at line 1280 of file BLI_math_matrix.hh.

References to_quaternion().

◆ to_quaternion_legacy()

Quaternion blender::math::to_quaternion_legacy ( const float3x3 & mat)
nodiscard

Extract quaternion rotation from transform matrix. Legacy version of to_quaternion which has slightly different behavior. Keep for particle-system & boids since replacing this will make subtle changes that impact hair in existing files. See: D15772.

Definition at line 442 of file math_matrix.cc.

References atan2(), conjugate(), cos(), normalize(), safe_acos(), sin(), to_quaternion_legacy(), transform_point(), blender::MatBase< T, NumCol, NumRow, Alignment >::x_axis(), and blender::MatBase< T, NumCol, NumRow, Alignment >::z_axis().

Referenced by rotate(), blender::tests::TEST(), and to_quaternion_legacy().

◆ to_rot_scale() [1/2]

template<bool AllowNegativeScale = false, typename T>
void blender::math::to_rot_scale ( const MatBase< T, 2, 2 > & mat,
AngleRadianBase< T > & r_rotation,
VecBase< T, 2 > & r_scale )
inline

Decompose a matrix into location, rotation, and scale components.

Template Parameters
AllowNegativeScaleif true, will compute determinant to know if matrix is negative. Rotation and scale values will be flipped if it is negative. This is a costly operation so it is disabled by default.

Definition at line 1353 of file BLI_math_matrix.hh.

References is_negative(), normalize_and_get_size(), to_rot_scale(), and blender::math::detail::to_rotation().

Referenced by interpolate_fast(), rotate(), to_loc_rot_scale(), to_loc_rot_scale(), to_rot_scale(), and to_rot_scale().

◆ to_rot_scale() [2/2]

template<bool AllowNegativeScale = false, typename T, typename RotationT>
void blender::math::to_rot_scale ( const MatBase< T, 3, 3 > & mat,
RotationT & r_rotation,
VecBase< T, 3 > & r_scale )
inline

◆ to_scale() [1/2]

template<bool AllowNegativeScale = false, typename T>
VecBase< T, 2 > blender::math::to_scale ( const MatBase< T, 2, 2 > & mat)
inlinenodiscard

Definition at line 1312 of file BLI_math_matrix.hh.

References is_negative(), length(), blender::result, and to_scale().

◆ to_scale() [2/2]

template<bool AllowNegativeScale = false, typename T, int NumCol, int NumRow>
VecBase< T, 3 > blender::math::to_scale ( const MatBase< T, NumCol, NumRow > & mat)
inlinenodiscard

◆ to_vector() [1/2]

◆ to_vector() [2/2]

template<typename T>
T blender::math::to_vector ( const AxisSigned axis)

◆ transform_direction() [1/4]

template float3 blender::math::transform_direction ( const float3x3 & mat,
const float3 & direction )
extern

References transform_direction().

◆ transform_direction() [2/4]

template float3 blender::math::transform_direction ( const float4x4 & mat,
const float3 & direction )
extern

References transform_direction().

◆ transform_direction() [3/4]

template<typename T>
VecBase< T, 3 > blender::math::transform_direction ( const MatBase< T, 3, 3 > & mat,
const VecBase< T, 3 > & direction )
nodiscard

Transform a 3d direction vector using a 3x3 matrix (rotation & scale).

Definition at line 1659 of file BLI_math_matrix.hh.

References transform_direction().

Referenced by blender::apply_to_curves_point_selection(), blender::assign_final_coords_from_mdisps(), blender::assign_final_elements_from_orig_mdisps(), blender::bke::subdiv::average_read_displacement_object(), blender::ed::sculpt_paint::calc_brush_plane(), blender::geometry::calc_position_with_interpolation(), blender::geometry::calc_position_without_interpolation(), blender::ed::sculpt_paint::cursor_geometry_info_update(), blender::ed::greasepencil::DrawingPlacement::DrawingPlacement(), blender::edbm_flatten_exec(), blender::bke::subdiv::eval_displacement(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::get_axis_gizmo_matrix_basis(), blender::workbench::get_light_data_from_studio_solidlight(), blender::ed::sculpt_paint::greasepencil::get_screen_projection_fn(), blender::ed::greasepencil::grease_pencil_texture_gradient_exec(), blender::workbench::ShadowPass::init(), blender::ed::sculpt_paint::gesture::init_common(), blender::ed::sculpt_paint::gesture::line_plane_from_tri(), blender::geometry::boolean::mesh_bm_concat(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_invoke(), blender::modify_drawing(), blender::multires_reshape_apply_base_update_mesh_coords(), blender::ed::transform::nearest_world_tree(), blender::nodes::node_fn_transform_direction_cc::node_build_multi_function(), blender::object_grid_element_to_tangent_displacement(), blender::ed::object::object_origin_set_exec(), blender::ed::greasepencil::pixel_radius_to_world_space_radius(), blender::ed::sculpt_paint::project_brush_radius_grease_pencil(), blender::ed::sculpt_paint::PuffOperationExecutor::puff(), blender::ed::transform::raycastMesh(), rotate(), blender::geometry::curve_constraints::solve_length_and_collision_constraints(), blender::ed::sculpt_paint::stroke_cache_common_init(), blender::ed::sculpt_paint::stroke_cache_init(), blender::ed::sculpt_paint::tilt_apply_to_normal(), blender::ed::transform::transdata_elem_translate(), transform_direction(), transform_direction(), transform_direction(), transform_direction(), blender::ed::greasepencil::boolean::transform_plane(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_rotate_transform_and_target_property(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_scale_transform_and_target_property(), and blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_translate_transform_and_target_property().

◆ transform_direction() [4/4]

template<typename T>
VecBase< T, 3 > blender::math::transform_direction ( const MatBase< T, 4, 4 > & mat,
const VecBase< T, 3 > & direction )
nodiscard

Transform a 3d direction vector using a 4x4 matrix (rotation & scale).

Definition at line 1665 of file BLI_math_matrix.hh.

References transform_direction().

◆ transform_direction_transposed() [1/2]

template<typename T>
VecBase< T, 3 > blender::math::transform_direction_transposed ( const MatBase< T, 3, 3 > & mat,
const VecBase< T, 3 > & direction )

mat is treated as if it were transposed. This is typically used for transforming normals which requires the use of the transpose of the inverse of the transformation matrix.

Definition at line 1676 of file BLI_math_matrix.hh.

References T, transform_direction_transposed(), blender::x, y, and z().

Referenced by blender::ed::transform::SnapData::register_result(), blender::ed::transform::SnapData::register_result_raycast(), transform_direction_transposed(), and transform_direction_transposed().

◆ transform_direction_transposed() [2/2]

template<typename T>
VecBase< T, 3 > blender::math::transform_direction_transposed ( const MatBase< T, 4, 4 > & mat,
const VecBase< T, 3 > & direction )

Definition at line 1689 of file BLI_math_matrix.hh.

References T, transform_direction_transposed(), blender::x, y, and z().

◆ transform_normals() [1/2]

◆ transform_normals() [2/2]

◆ transform_point() [1/9]

template<typename T>
VecBase< T, 3 > blender::math::transform_point ( const CartesianBasis & basis,
const VecBase< T, 3 > & v )
inlinenodiscard

Definition at line 446 of file BLI_math_basis_types.hh.

References blender::math::Axis::as_int(), blender::math::AxisSigned::axis(), blender::math::AxisSigned::is_negative(), blender::result, transform_point(), blender::v, blender::math::CartesianBasis::x(), blender::math::CartesianBasis::y(), and blender::math::CartesianBasis::z().

Referenced by blender::bke::BoneDeformLinearMixer< full_deform >::accumulate(), blender::bke::BoneDeformLinearMixer< full_deform >::accumulate_bbone(), blender::geometry::add_curves_on_mesh(), blender::nodes::node_fn_align_rotation_to_vector_cc::align_rotations_auto_pivot(), blender::nodes::node_fn_align_rotation_to_vector_cc::align_rotations_fixed_pivot(), blender::ed::sculpt_paint::apply_crazyspace_to_translations(), blender::apply_gradient_tint(), blender::apply_stroke_transform(), blender::apply_to_curves_point_selection(), blender::ed::transform::applyTranslationValue(), blender::bke::armature_vert_task_with_mixer(), blender::BKE_grease_pencil_point_coords_apply(), blender::BKE_grease_pencil_point_coords_apply_with_mat4(), blender::BKE_grease_pencil_point_coords_get(), blender::BKE_object_minmax(), blender::draw::overlay::BoneInstanceData::BoneInstanceData(), blender::ed::greasepencil::boundary_to_curves(), blender::bounds_min_max_with_transform(), blender::ed::sculpt_paint::calc_brush_plane(), blender::ed::sculpt_paint::calc_local_positions(), blender::ed::sculpt_paint::calc_local_positions(), blender::ed::sculpt_paint::calc_local_positions(), blender::ed::sculpt_paint::calc_local_positions(), blender::ed::sculpt_paint::pose::calc_segment_translations(), blender::seq::calc_strip_transform_matrix(), blender::ed::sculpt_paint::calc_symm_area_transform_translations(), blender::ed::sculpt_paint::calc_transform_translations(), blender::ed::sculpt_paint::trim::calculate_depth(), blender::ed::transform::calculate_new_origin_position(), blender::geometry::profile::calculate_profile_segments(), blender::ed::sculpt_paint::clip_and_lock_translations(), blender::ed::sculpt_paint::clip_and_lock_translations(), blender::ed::sculpt_paint::cloth::cloth_brush_solve_collision(), blender::ed::sculpt_paint::CombOperationExecutor::comb_projected(), blender::ed::sculpt_paint::CombOperationExecutor::comb_spherical_with_symmetry(), blender::ed::vse::cursor_set_by_mouse_position(), blender::ed::greasepencil::boolean::curve_boolean_with_planes(), blender::ed::sculpt_paint::CutOperationExecutor::cut_curves(), blender::deform_drawing(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_projected(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_spherical_with_symmetry(), blender::dims_apply_restore(), blender::dims_apply_store(), blender::io::usd::USDHairWriter::do_write(), blender::ed::greasepencil::image_render::draw_circles(), blender::ed::greasepencil::draw_control_points(), blender::ed::greasepencil::image_render::draw_dot(), blender::ed::greasepencil::image_render::draw_dots(), blender::ed::greasepencil::image_render::draw_grease_pencil_stroke(), blender::ed::greasepencil::image_render::draw_lines(), blender::ed::greasepencil::image_render::draw_polyline(), blender::draw::drw_debug_matrix(), blender::drw_shgroup_bone_relationship_lines_ex(), blender::drw_shgroup_bone_stick(), blender::DRW_text_edit_mesh_measure_stats(), blender::edbm_fit_edge_loops_to_annotation_exec(), blender::edbm_rip_edge_exec(), blender::ed::sculpt_paint::ensure_valid_pivot(), blender::xpbd::evaluate_rod_stretch_and_shear_constraint(), blender::ed::sculpt_paint::AddOperationExecutor::execute(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::execute(), blender::ed::sculpt_paint::CutOperationExecutor::execute(), blender::ed::sculpt_paint::PinchOperationExecutor::execute(), blender::ed::sculpt_paint::PuffOperationExecutor::execute(), blender::ed::sculpt_paint::SmoothOperationExecutor::execute(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::execute(), blender::geometry::extend_curve_curved(), blender::bke::fill_mesh_positions(), blender::ed::sculpt_paint::filter_region_clip_factors(), blender::ed::sculpt_paint::filter_region_clip_factors(), blender::ed::sculpt_paint::PuffOperationExecutor::find_curve_weights_projected(), blender::ed::sculpt_paint::SlideOperationExecutor::find_curves_to_slide(), blender::ed::sculpt_paint::SlideOperationExecutor::find_curves_to_slide_with_symmetry(), blender::ed::sculpt_paint::PuffOperationExecutor::find_curves_weights_spherical_with_symmetry(), blender::ed::sculpt_paint::CutOperationExecutor::find_projected_points_in_stroke(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_projected_smooth_factors(), blender::ed::sculpt_paint::CutOperationExecutor::find_spherical_points_in_stroke_with_symmetry(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_spherical_smooth_factors_with_symmetry(), from_triangle(), from_vector(), blender::draw::View::frustum_boundbox_calc(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_projected(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_spherical(), blender::ed::greasepencil::get_boundary_bounds(), blender::get_distance_factor(), blender::ed::sculpt_paint::greasepencil::get_screen_projection_fn(), blender::ed::sculpt_paint::grease_pencil_cursor_draw(), blender::ed::sculpt_paint::grease_pencil_fill_extension_cut(), blender::ed::sculpt_paint::grease_pencil_fill_extension_lines_from_circles(), blender::ed::sculpt_paint::grease_pencil_fill_get_extension_data(), blender::draw::grease_pencil_geom_batch_ensure(), blender::ed::greasepencil::grease_pencil_reproject_exec(), blender::ed::greasepencil::grease_pencil_snap_compute_centroid(), blender::ed::greasepencil::grease_pencil_snap_to_cursor_exec(), blender::ed::greasepencil::grease_pencil_snap_to_grid_exec(), blender::ed::greasepencil::grease_pencil_texture_gradient_exec(), blender::seq::image_transform_quad_get(), blender::ed::sculpt_paint::imapaint_pick_face(), blender::init_curves_point_selection_status(), blender::ViewOpsData::init_navigation(), blender::ed::sculpt_paint::CombOperationExecutor::initialize_spherical_brush_reference_point(), blender::ed::sculpt_paint::DeleteOperationExecutor::initialize_spherical_brush_reference_point(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::initialize_spherical_brush_reference_point(), blender::ed::curves::pen_tool::PenToolOperation::layer_to_screen(), blender::ed::sculpt_paint::gesture::line_plane_from_tri(), blender::median_bounds_add(), blender::median_dims_scale_matrix_calc(), blender::geometry::boolean::mesh_bm_concat(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_draw(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_invoke(), blender::MOD_lineart_gpencil_generate_v3(), blender::ed::sculpt_paint::PaintStroke::modal(), blender::ed::transform::nearest_world_tree(), blender::nodes::node_fn_rotate_vector_cc::node_build_multi_function(), blender::nodes::node_fn_transform_point_cc::node_build_multi_function(), blender::nodes::node_geo_tool_3d_cursor_cc::node_geo_exec(), blender::ed::sculpt_paint::node_in_box(), blender::ed::object::object_origin_set_exec(), blender::draw::overlay::Relations::object_sync(), blender::ed::sculpt_paint::greasepencil::CloneOperation::on_stroke_begin(), blender::ed::sculpt_paint::greasepencil::TintOperation::on_stroke_begin(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::paint_curve_selection_spherical_with_symmetry(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::paint_point_selection_spherical_with_symmetry(), blender::ed::sculpt_paint::paint_space_stroke_spacing(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_projected(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_spherical_with_symmetry(), blender::ed::greasepencil::pixel_radius_to_world_space_radius(), blender::ed::sculpt_paint::pixel_radius_update(), blender::ed::greasepencil::DrawingPlacement::place(), blender::ed::greasepencil::primitive_local_to_screen(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), blender::ed::greasepencil::DrawingPlacement::project(), blender::io::grease_pencil::GreasePencilExporter::project_to_screen(), blender::ed::greasepencil::DrawingPlacement::project_with_shift(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::projected_snake_hook(), blender::ed::sculpt_paint::PuffOperationExecutor::puff(), blender::ed::sculpt_paint::raycast_init(), blender::ed::transform::raycastMesh(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::reduce_density_spherical_with_symmetry(), blender::ed::transform::SnapData::register_result(), blender::ed::transform::SnapData::register_result_raycast(), blender::ed::greasepencil::DrawingPlacement::reproject(), rotate(), blender::ed::sculpt_paint::sample_curves_3d_brush(), blender::ed::sculpt_paint::sample_curves_surface_3d_brush(), blender::ed::sculpt_paint::AddOperationExecutor::sample_in_center_with_symmetry(), blender::ed::sculpt_paint::AddOperationExecutor::sample_projected(), blender::ed::sculpt_paint::DensityAddOperationExecutor::sample_projected_with_symmetry(), blender::ed::sculpt_paint::AddOperationExecutor::sample_spherical_with_symmetry(), blender::ed::sculpt_paint::DensityAddOperationExecutor::sample_spherical_with_symmetry(), blender::ed::curves::pen_tool::PenToolOperation::screen_to_layer(), blender::ed::vse::sequencer_text_editing_cursor_region_xy_get(), blender::io::grease_pencil::shape_attributes_to_curves(), blender::geometry::construct::snap_to_pipe_profile(), blender::ed::transform::snapCamera(), blender::geometry::curve_constraints::solve_length_and_collision_constraints(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::spherical_snake_hook_with_symmetry(), blender::seq::strip_result_covers_strip_quad(), blender::eevee::ShadowTileMap::sync_cubeface(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::ed::vse::text_edit_draw_cursor(), blender::ed::vse::text_selection_draw(), to_quaternion_legacy(), blender::bounds::transform_bounds(), blender::bounds::transform_bounds(), blender::ed::sculpt_paint::transform_brush_radius(), blender::ed::greasepencil::boolean::transform_plane(), transform_point(), transform_point(), transform_point(), transform_point(), transform_point(), transform_point(), transform_point(), transform_point(), transform_point(), transform_points_no_threading(), transform_points_no_threading(), blender::bke::crazyspace::GeometryDeformation::translation_from_deformed_to_original(), blender::geometry::construct::tri_corner_adj_vmesh(), blender::ed::curves::convert_to_particle_system::try_convert_single_object(), blender::image_engine::OneTexture::update_bounds(), blender::image_engine::ScreenTileTextures< Divisions >::update_bounds(), blender::view3d_calc_point_in_selected_bounds(), blender::view3d_orbit_calc_center(), blender::ed::sculpt_paint::greasepencil::view_positions_from_curve_mask(), blender::ed::sculpt_paint::greasepencil::view_positions_from_point_mask(), blender::ed::sculpt_paint::greasepencil::view_positions_left_from_point_mask(), blender::ed::sculpt_paint::greasepencil::view_positions_right_from_point_mask(), blender::ed::sculpt_paint::greasepencil::view_radii_from_point_selection(), blender::eevee::VolumeObjectBounds::VolumeObjectBounds(), blender::WIDGETGROUP_camera_refresh(), blender::io::obj::OBJWriter::write_vertex_coords(), and blender::write_weights_for_drawing().

◆ transform_point() [2/9]

template<typename T>
VecBase< T, 3 > blender::math::transform_point ( const DualQuaternionBase< T > & dq,
const VecBase< T, 3 > & point,
MatBase< T, 3, 3 > * r_crazy_space_mat = nullptr )
nodiscard

Transform point using the dual-quaternion dq . Applying the DualQuaternion transform can only happen if the DualQuaternion was normalized first. Optionally outputs crazy space matrix.

From: "Skinning with Dual Quaternions" Ladislav Kavan, Steven Collins, Jiri Zara, Carol O'Sullivan Trinity College Dublin, Czech Technical University in Prague

Definition at line 492 of file BLI_math_quaternion.hh.

References blender::BLI_assert(), is_normalized(), is_unit_scale(), M, blender::math::DualQuaternionBase< T >::quat, blender::result, blender::math::DualQuaternionBase< T >::scale, blender::math::DualQuaternionBase< T >::scale_weight, T, blender::math::DualQuaternionBase< T >::trans, and transform_point().

◆ transform_point() [3/9]

template float3 blender::math::transform_point ( const float3x3 & mat,
const float3 & point )
extern

References transform_point().

◆ transform_point() [4/9]

template float3 blender::math::transform_point ( const float4x4 & mat,
const float3 & point )
extern

References transform_point().

◆ transform_point() [5/9]

template<typename T>
VecBase< T, 2 > blender::math::transform_point ( const MatBase< T, 2, 2 > & mat,
const VecBase< T, 2 > & point )
nodiscard

Transform a 2d point using a 2x2 matrix (rotation & scale).

Definition at line 1635 of file BLI_math_matrix.hh.

References transform_point().

◆ transform_point() [6/9]

template<typename T>
VecBase< T, 2 > blender::math::transform_point ( const MatBase< T, 3, 3 > & mat,
const VecBase< T, 2 > & point )
nodiscard

Transform a 2d point using a 3x3 matrix (location & rotation & scale).

Definition at line 1641 of file BLI_math_matrix.hh.

References blender::MatBase< T, NumCol, NumRow, Alignment >::location(), and transform_point().

◆ transform_point() [7/9]

template<typename T>
VecBase< T, 3 > blender::math::transform_point ( const MatBase< T, 3, 3 > & mat,
const VecBase< T, 3 > & point )
nodiscard

Transform a 3d point using a 3x3 matrix (rotation & scale).

Definition at line 1647 of file BLI_math_matrix.hh.

References transform_point().

◆ transform_point() [8/9]

template<typename T>
VecBase< T, 3 > blender::math::transform_point ( const MatBase< T, 4, 4 > & mat,
const VecBase< T, 3 > & point )
nodiscard

Transform a 3d point using a 4x4 matrix (location & rotation & scale).

Definition at line 1653 of file BLI_math_matrix.hh.

References blender::MatBase< T, NumCol, NumRow, Alignment >::location(), and transform_point().

◆ transform_point() [9/9]

template<typename T>
VecBase< T, 3 > blender::math::transform_point ( const QuaternionBase< T > & q,
const VecBase< T, 3 > & v )
inlinenodiscard

◆ transform_points() [1/2]

void blender::math::transform_points ( const float4x4 & transform,
MutableSpan< float3 > points,
bool use_threading = true )

Transform point vectors with matrix multiplication, optionally using multi-threading.

Definition at line 646 of file math_matrix.cc.

References blender::MutableSpan< T >::index_range(), blender::threading::parallel_for(), skip_transform(), transform_points(), and transform_points_no_threading().

Referenced by blender::ed::greasepencil::add_armature_automatic_weights(), blender::ed::greasepencil::add_armature_envelope_weights(), blender::ed::object::apply_objects_internal(), blender::ed::greasepencil::bake_grease_pencil_animation_exec(), blender::ed::sculpt_paint::brushes::calc_bmesh(), blender::ed::sculpt_paint::brushes::calc_faces(), blender::ed::sculpt_paint::brushes::calc_grids(), blender::ed::object::convert_grease_pencil_to_mesh(), blender::ed::greasepencil::create_curves_outline(), blender::ed::object::data_xform_by_mat4(), blender::ed::sculpt_paint::DensityAddOperationExecutor::execute(), blender::geometry::execute_realize_curve_task(), blender::geometry::execute_realize_mesh_task(), blender::geometry::execute_realize_pointcloud_task(), blender::geometry::execute_realize_pointcloud_tasks(), blender::io::grease_pencil::GreasePencilExporter::foreach_shape_in_layer(), blender::draw::grease_pencil_cache_add_nurbs(), blender::draw::grease_pencil_edit_batch_ensure(), blender::draw::grease_pencil_weight_batch_ensure(), blender::ed::mesh::join_positions(), blender::ed::mesh::join_shape_keys(), blender::bke::mesh_transform(), blender::ed::sculpt_paint::greasepencil::process_stroke_weights(), blender::ed::sculpt_paint::brushes::sample_node_surface_bmesh(), blender::ed::sculpt_paint::brushes::sample_node_surface_grids(), blender::ed::sculpt_paint::brushes::sample_node_surface_mesh(), blender::bke::CurvesGeometry::transform(), blender::geometry::transform_curve_edit_hints(), blender::geometry::transform_grease_pencil_edit_hints(), blender::geometry::transform_pointcloud(), transform_points(), and transform_points().

◆ transform_points() [2/2]

void blender::math::transform_points ( Span< float3 > src,
const float4x4 & transform,
MutableSpan< float3 > dst,
bool use_threading = true )

◆ transform_points_no_threading() [1/2]

void blender::math::transform_points_no_threading ( const float4x4 & transform,
MutableSpan< float3 > points )
static

◆ transform_points_no_threading() [2/2]

void blender::math::transform_points_no_threading ( const Span< float3 > src,
const float4x4 & transform,
MutableSpan< float3 > dst )
static

◆ translate()

◆ transpose()

template<typename T, int NumCol, int NumRow>
MatBase< T, NumCol, NumRow > blender::math::transpose ( const MatBase< T, NumRow, NumCol > & mat)
nodiscard

Flip the matrix across its diagonal. Also flips dimensions for non square matrices.

Definition at line 657 of file BLI_math_matrix.hh.

References blender::result, transpose(), and blender::unroll().

Referenced by blender::ocio::LibOCIOView::append_scope_space_transforms(), blender::ed::greasepencil::calculate_texture_space(), blender::ed::transform::SnapData::clip_planes_enable(), blender::ocio::create_ocio_display_processor(), blender::nodes::node_geo_scale_elements_cc::create_single_axis_transform(), blender::ocio::create_untonemapped_ocio_display_transform(), blender::bke::CurvesSurfaceTransforms::CurvesSurfaceTransforms(), blender::ocio::display_as_extended_srgb(), blender::io::usd::USDTransformWriter::do_write(), blender::ed::greasepencil::DrawingPlacement::DrawingPlacement(), blender::io::usd::ensure_root_prim(), blender::ed::spreadsheet::format_matrix_to_grid(), blender::get_legacy_stroke_matrix(), blender::ed::greasepencil::grease_pencil_texture_gradient_exec(), blender::nodes::node_fn_transpose_matrix_cc::node_build_multi_function(), polar_decompose(), pseudo_invert(), blender::draw::sculpt_batches_get_ex(), blender::bke::greasepencil::Drawing::set_texture_matrices(), blender::eevee::VolumeProbeModule::set_view(), blender::eevee::Camera::sync(), blender::eevee::ShadowTileMap::sync_cubeface(), blender::eevee::ShadowTileMap::sync_orthographic(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::math::tests::TEST(), transform_normals(), transform_normals(), blender::tests::transform_normals_test(), and transpose().

◆ vector_hash()

◆ whitepoint_from_temp_tint()

◆ whitepoint_to_temp_tint()

◆ wrap_coord() [1/2]

int32_t blender::math::wrap_coord ( float u,
int32_t size )
inlinenodiscard

Equal to int(mod_periodic(u, float(size))) for |u| <= MAXINT. However other values of u, including inf and NaN, produce in-range values, this is also at least 5% faster.

Definition at line 229 of file BLI_math_interp.hh.

References floor(), wrap_coord(), and blender::x.

◆ wrap_coord() [2/2]

Variable Documentation

◆ is_math_float_type

template<typename T>
bool blender::math::is_math_float_type = std::is_floating_point_v<T>
inlineconstexpr

◆ is_math_integral_type

template<typename T>
bool blender::math::is_math_integral_type = std::is_integral_v<T>
inlineconstexpr

Definition at line 21 of file BLI_math_base.hh.

◆ planck_locus

const std::array<locus_entry_t, 31> blender::math::planck_locus
static
Initial value:
{{
{0.0f, {0.18006f, 0.26352f}, -0.24341f}, {10.0f, {0.18066f, 0.26589f}, -0.25479f},
{20.0f, {0.18133f, 0.26846f}, -0.26876f}, {30.0f, {0.18208f, 0.27119f}, -0.28539f},
{40.0f, {0.18293f, 0.27407f}, -0.30470f}, {50.0f, {0.18388f, 0.27709f}, -0.32675f},
{60.0f, {0.18494f, 0.28021f}, -0.35156f}, {70.0f, {0.18611f, 0.28342f}, -0.37915f},
{80.0f, {0.18740f, 0.28668f}, -0.40955f}, {90.0f, {0.18880f, 0.28997f}, -0.44278f},
{100.0f, {0.19032f, 0.29326f}, -0.47888f}, {125.0f, {0.19462f, 0.30141f}, -0.58204f},
{150.0f, {0.19962f, 0.30921f}, -0.70471f}, {175.0f, {0.20525f, 0.31647f}, -0.84901f},
{200.0f, {0.21142f, 0.32312f}, -1.0182f}, {225.0f, {0.21807f, 0.32909f}, -1.2168f},
{250.0f, {0.22511f, 0.33439f}, -1.4512f}, {275.0f, {0.23247f, 0.33904f}, -1.7298f},
{300.0f, {0.24010f, 0.34308f}, -2.0637f}, {325.0f, {0.24792f, 0.34655f}, -2.4681f},
{350.0f, {0.25591f, 0.34951f}, -2.9641f}, {375.0f, {0.26400f, 0.35200f}, -3.5814f},
{400.0f, {0.27218f, 0.35407f}, -4.3633f}, {425.0f, {0.28039f, 0.35577f}, -5.3762f},
{450.0f, {0.28863f, 0.35714f}, -6.7262f}, {475.0f, {0.29685f, 0.35823f}, -8.5955f},
{500.0f, {0.30505f, 0.35907f}, -11.324f}, {525.0f, {0.31320f, 0.35968f}, -15.628f},
{550.0f, {0.32129f, 0.36011f}, -23.325f}, {575.0f, {0.32931f, 0.36038f}, -40.770f},
{600.0f, {0.33724f, 0.36051f}, -116.45f},
}}

Definition at line 911 of file math_color.cc.

Referenced by whitepoint_from_temp_tint(), and whitepoint_to_temp_tint().