25 static boost::mt19937 gen(5);
36 sphere[0] = cartesian.lpNorm<2>();
37 sphere[1] =
asin(cartesian[2]);
38 sphere[2] =
atan2(cartesian[1], cartesian[0]);
48 cartesian[0] = sphere[0] *
cos(sphere[1]) *
cos(sphere[2]);
49 cartesian[1] = sphere[0] * cos(sphere[1]) *
sin(sphere[2]);
50 cartesian[2] = sphere[0] * sin(sphere[1]);
60 resultAxis = orientation.toRotationMatrix() * SimpleVector3::UnitX();
64 return (value == 0 ? 0.0 : (value < 0 ? -1.0 : 1.0));
68 return SimpleVector3((idx == 0 ? 0 : X[0]), (idx == 1 ? 0 : X[1]), (idx == 2 ? 0 : X[2]));
75 if (xNorm == 0 || yNorm == 0) {
78 return X.dot(Y) / xNorm / yNorm;
88 Precision angleDiff = fabs(firstAngle - secondAngle);
89 return fmin(angleDiff, 2 * M_PI - angleDiff);
93 boost::uniform_int<> uniform(min, max);
99 boost::normal_distribution<Precision> uniform(mean, standardDeviation);
107 for (
int i = 0; i < mean.rows(); i++) {
119 double c1 =
cos(heading / 2);
120 double c2 =
cos(attitude / 2);
121 double c3 =
cos(bank / 2);
122 double s1 =
sin(heading / 2);
123 double s2 =
sin(attitude / 2);
124 double s3 =
sin(bank / 2);
133 return result.normalized();
140 float dlong = M_PI * (3.0 -
sqrt(5.0));
141 float dz = 2.0 / numberOfPoints;
142 float longitude = 0.0;
143 float z = 1.0 - dz / 2.0;
145 for (
int k = 0; k < numberOfPoints; k += 1) {
146 float r =
sqrt(1.0 -
pow(z, 2));
149 point[0] =
cos(longitude) * r;
150 point[1] =
sin(longitude) * r;
155 oritentationCollectionPtr->push_back(orientation);
164 return oritentationCollectionPtr;
169 return fmod(input / M_PI * 180.0, 360);
173 return fmod(input / 180.0 * M_PI, 2 * M_PI);
178 return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2];
static SimpleQuaternion getRandomQuaternion()
static SimpleVector3 convertS2C(const SimpleSphereCoordinates &sphere)
converts sphere coordinates to cartesian coordinates (lightweight)
static double degToRad(double input)
static boost::mt19937 & getRandomnessGenerator()
static Precision getRandomNumber(const Precision &mean, const Precision &standardDeviation)
Eigen::Matrix< Precision, 3, 1 > SimpleVector3
static double getSignum(const double &value)
static SimpleVector3 getVisualAxis(const SimpleQuaternion &orientation)
TFSIMD_FORCE_INLINE tfScalar angle(const Quaternion &q1, const Quaternion &q2)
SimpleVector3 SimpleSphereCoordinates
static double radToDeg(double input)
static SimpleVector3 getProjection(const std::size_t &idx, const SimpleVector3 &X)
Eigen::Matrix< Precision, Eigen::Dynamic, 1 > SimpleVectorX
std::vector< SimpleQuaternion, Eigen::aligned_allocator< SimpleQuaternion > > SimpleQuaternionCollection
static Precision getCosinus(const SimpleVector3 &X, const SimpleVector3 &Y)
INLINE Rall1d< T, V, S > asin(const Rall1d< T, V, S > &x)
this namespace contains all generally usable classes.
static SimpleVectorX getRandomVector(const SimpleVectorX &mean, const SimpleVectorX &standardDeviation)
static SimpleQuaternionCollectionPtr getOrientationsOnUnitSphere(const int &numberOfPoints)
INLINE Rall1d< T, V, S > sqrt(const Rall1d< T, V, S > &arg)
static Precision getMinimumAngleDifference(const Precision &firstAngle, const Precision &secondAngle)
static SimpleSphereCoordinates convertC2S(const SimpleVector3 &cartesian)
converts cartesian coordinates to sphere coordinates
INLINE Rall1d< T, V, S > pow(const Rall1d< T, V, S > &arg, double m)
static int getRandomInteger(const int &min, const int &max)
INLINE Rall1d< T, V, S > acos(const Rall1d< T, V, S > &x)
INLINE Rall1d< T, V, S > atan2(const Rall1d< T, V, S > &y, const Rall1d< T, V, S > &x)
static Precision getAngle(const SimpleVector3 &X, const SimpleVector3 &Y)
static SimpleQuaternion getQuaternionByAngles(const Precision &heading, const Precision &attitude, const Precision &bank)
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
IMETHOD void random(Vector &a)
static double getDotProduct(SimpleVector3 v1, SimpleVector3 v2)
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)
Eigen::Quaternion< Precision > SimpleQuaternion