27 sincos(angle, &s, &c);
39 sincos(angle, &s, &c);
51 sincos(angle, &s, &c);
62 double theta = axis.norm();
63 Vec3 w = axis / theta;
66 return Mat3::Identity() + sin(theta) *
W + (1 -
cos(theta)) *
W *
W;
70 Vec3 zc = center.normalized();
71 Vec3 xc = Vec3::UnitY().cross(zc).normalized();
72 Vec3 yc = zc.cross(xc);
92 Vec* variance_pointer) {
93 Vec& mean = *mean_pointer;
94 Vec& variance = *variance_pointer;
100 for (
int i = 0; i < n; ++i) {
103 for (
int j = 0; j < m; ++j) {
106 variance(i) += x *
x;
111 for (
int i = 0; i < n; ++i) {
112 variance(i) = variance(i) / m -
Square(mean(i));
117 assert(left.rows() == right.rows());
119 int m1 = left.cols();
120 int m2 = right.cols();
122 stacked->resize(n, m1 + m2);
123 stacked->block(0, 0, n, m1) =
left;
124 stacked->block(0, m1, n, m2) = right;
128 assert(A.rows() == 2);
129 *
v <<
A(0, i),
A(1, i);
132 assert(A.rows() == 3);
133 *
v <<
A(0, i),
A(1, i),
A(2, i);
136 assert(A.rows() == 4);
137 *
v <<
A(0, i),
A(1, i),
A(2, i),
A(3, i);
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
ccl_device_inline float3 cos(float3 v)
Mat3 CrossProductMatrix(const Vec3 &x)
Eigen::Matrix< double, 3, 3 > Mat3
Mat3 RotationAroundX(double angle)
void MatrixColumn(const Mat &A, int i, Vec2 *v)
void MeanAndVarianceAlongRows(const Mat &A, Vec *mean_pointer, Vec *variance_pointer)
Mat3 RotationRodrigues(const Vec3 &axis)
void HorizontalStack(const Mat &left, const Mat &right, Mat *stacked)
Mat3 RotationAroundZ(double angle)
Mat3 RotationAroundY(double angle)