Blender  V3.3
Namespaces | Functions
BLI_math_rotation_test.cc File Reference
#include "testing/testing.h"
#include "BLI_math_base.h"
#include "BLI_math_rotation.h"
#include "BLI_math_rotation.hh"
#include "BLI_math_vector.hh"
#include "BLI_vector.hh"
#include <cmath>

Go to the source code of this file.

Namespaces

 blender
 
 blender::math
 
 blender::math::tests
 

Functions

static void test_quat_to_mat_to_quat (float w, float x, float y, float z)
 
 TEST (math_rotation, quat_to_mat_to_quat_rot180)
 
 TEST (math_rotation, quat_to_mat_to_quat_rot180n)
 
 TEST (math_rotation, quat_to_mat_to_quat_rot90)
 
 TEST (math_rotation, quat_to_mat_to_quat_rot90n)
 
 TEST (math_rotation, quat_to_mat_to_quat_bad_T83196)
 
 TEST (math_rotation, quat_to_mat_to_quat_bad_negative)
 
 TEST (math_rotation, quat_to_mat_to_quat_near_1000)
 
 TEST (math_rotation, quat_to_mat_to_quat_near_0100)
 
 TEST (math_rotation, quat_to_mat_to_quat_near_0010)
 
 TEST (math_rotation, quat_to_mat_to_quat_near_0001)
 
 TEST (math_rotation, quat_split_swing_and_twist_negative)
 
 blender::math::tests::TEST (math_rotation, RotateDirectionAroundAxis)
 
Test <tt>sin_cos_from_fraction</tt> Accuracy & Exact Symmetry
static void test_sin_cos_from_fraction_accuracy (const int range, const float expected_eps)
 
 TEST (math_rotation, sin_cos_from_fraction_accuracy)
 
static void test_sin_cos_from_fraction_symmetry (const int range)
 
 TEST (math_rotation, sin_cos_from_fraction_symmetry)
 

Function Documentation

◆ TEST() [1/13]

TEST ( math_rotation  ,
quat_split_swing_and_twist_negative   
)

Definition at line 141 of file BLI_math_rotation_test.cc.

References input, M_PI, quat_split_swing_and_twist(), and sqrtf.

◆ TEST() [2/13]

TEST ( math_rotation  ,
quat_to_mat_to_quat_bad_negative   
)

Definition at line 79 of file BLI_math_rotation_test.cc.

References sqrtf, and test_quat_to_mat_to_quat().

◆ TEST() [3/13]

TEST ( math_rotation  ,
quat_to_mat_to_quat_bad_T83196   
)

Definition at line 70 of file BLI_math_rotation_test.cc.

References test_quat_to_mat_to_quat().

◆ TEST() [4/13]

TEST ( math_rotation  ,
quat_to_mat_to_quat_near_0001   
)

Definition at line 127 of file BLI_math_rotation_test.cc.

References test_quat_to_mat_to_quat().

◆ TEST() [5/13]

TEST ( math_rotation  ,
quat_to_mat_to_quat_near_0010   
)

Definition at line 113 of file BLI_math_rotation_test.cc.

References test_quat_to_mat_to_quat().

◆ TEST() [6/13]

TEST ( math_rotation  ,
quat_to_mat_to_quat_near_0100   
)

Definition at line 99 of file BLI_math_rotation_test.cc.

References test_quat_to_mat_to_quat().

◆ TEST() [7/13]

TEST ( math_rotation  ,
quat_to_mat_to_quat_near_1000   
)

Definition at line 85 of file BLI_math_rotation_test.cc.

References test_quat_to_mat_to_quat().

◆ TEST() [8/13]

TEST ( math_rotation  ,
quat_to_mat_to_quat_rot180   
)

Definition at line 32 of file BLI_math_rotation_test.cc.

References test_quat_to_mat_to_quat().

◆ TEST() [9/13]

TEST ( math_rotation  ,
quat_to_mat_to_quat_rot180n   
)

Definition at line 40 of file BLI_math_rotation_test.cc.

References test_quat_to_mat_to_quat().

◆ TEST() [10/13]

TEST ( math_rotation  ,
quat_to_mat_to_quat_rot90   
)

Definition at line 48 of file BLI_math_rotation_test.cc.

References sqrtf, and test_quat_to_mat_to_quat().

◆ TEST() [11/13]

TEST ( math_rotation  ,
quat_to_mat_to_quat_rot90n   
)

Definition at line 59 of file BLI_math_rotation_test.cc.

References sqrtf, and test_quat_to_mat_to_quat().

◆ TEST() [12/13]

TEST ( math_rotation  ,
sin_cos_from_fraction_accuracy   
)

Ensure the result of sin_cos_from_fraction match sinf & cosf.

Definition at line 171 of file BLI_math_rotation_test.cc.

References test_sin_cos_from_fraction_accuracy().

◆ TEST() [13/13]

TEST ( math_rotation  ,
sin_cos_from_fraction_symmetry   
)

Definition at line 247 of file BLI_math_rotation_test.cc.

References test_sin_cos_from_fraction_symmetry().

◆ test_quat_to_mat_to_quat()

static void test_quat_to_mat_to_quat ( float  w,
float  x,
float  y,
float  z 
)
static

Definition at line 15 of file BLI_math_rotation_test.cc.

References mat3_normalized_to_quat(), mul_qt_fl(), normalize_qt_qt(), quat_to_mat3(), w(), x, y, and z.

Referenced by TEST().

◆ test_sin_cos_from_fraction_accuracy()

static void test_sin_cos_from_fraction_accuracy ( const int  range,
const float  expected_eps 
)
static

Definition at line 159 of file BLI_math_rotation_test.cc.

References cosf, float(), M_PI, sin_cos_from_fraction(), and sinf.

Referenced by TEST().

◆ test_sin_cos_from_fraction_symmetry()

static void test_sin_cos_from_fraction_symmetry ( const int  range)
static