94 for (
float i = -200.0;
i <= 200.0;
i += 0.001)
102 for (
float i = -200.0;
i <= 200.0;
i += 0.001)
111 for (
float i = -100.0;
i <= 100.0;
i += 0.1)
113 for (
float j = -1.0; j <= 1.0; j += 0.001)
115 if (
fabs(j) > 0.0001)
125 for (
float i = -1.0;
i <= 1.0;
i += 0.001)
141 float trueResult = 0.0;
142 for (
int i = 69682;
i < 106597;
i++)
144 trueResult =
static_cast<float>((1.0 - pow(static_cast<float>(
i) / 101325, 0.190284)) * 145366.45)
145 *
static_cast<float>(0.3048);
154 for (
int i = 0;
i < 24;
i++)
158 Eigen::Vector3f eig2, eig1;
159 eig1 << vec1.
x, vec1.
y, vec1.
z;
160 eig2 << vec2.
x, vec2.
y, vec2.
z;
171 Eigen::Vector3f eig3 = eig1;
205 for (
int i = 0;
i < 24;
i++)
210 Eigen::Quaternionf eig1(quat1.
w, quat1.
x, quat1.
y, quat1.
z);
211 Eigen::Quaternionf eig2(quat2.
w, quat2.
x, quat2.
y, quat2.
z);
226 Eigen::Vector3f veig1;
227 veig1 << vec1.
x, vec1.y, vec1.z;
231 Eigen::Vector3f veig2 = veig1.transpose() * eig1.toRotationMatrix();
243 Eigen::Vector3f ihat(1, 0, 0);
244 Eigen::Vector3f jhat(0, 1, 0);
245 Eigen::Vector3f khat(0, 0, 1);
247 Eigen::Quaternionf eig3 = Eigen::AngleAxisf(s, khat) * Eigen::AngleAxisf(t, jhat) * Eigen::AngleAxisf(p, ihat);
257 TEST(TurboMath, QuatFromTwoVectors)
269 for (
int i = 0;
i < 25;
i++)
float dot(const Vector &v) const
#define ASSERT_SUPERCLOSE(x, y)
Vector cross(const Vector &v) const
float atan2(float y, float x)
#define EXPECT_SUPERCLOSE(x, y)
void get_RPY(float *roll, float *pitch, float *yaw) const
#define ASSERT_TURBOQUAT_SUPERCLOSE(q, q2)
#define ASSERT_QUAT_SUPERCLOSE(q, q_eig)
Vector normalized() const
Quaternion & from_two_unit_vectors(const Vector &u, const Vector &v)
turbomath::Quaternion random_quaternions[25]
#define EXPECT_VEC3_SUPERCLOSE(vec, eig)
turbomath::Vector random_vectors[25]
Quaternion inverse() const
#define EXPECT_QUAT_SUPERCLOSE(q, q_eig)
Vector rotate(const Vector &v) const