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;
129 *v <<
A(0, i),
A(1, i);
133 *v <<
A(0, i),
A(1, i),
A(2, i);
137 *v <<
A(0, i),
A(1, i),
A(2, i),
A(3, i);
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
#define assert(assertion)
ccl_device_inline void sincos(const float3 x, ccl_private float3 *sine, ccl_private float3 *cosine)
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)