Go to the documentation of this file.
7 float sqr(
float a) {
return a*a;}
11 float magnitude(
Vector v) {
17 printf(
"Cant normalize ZERO vector\n");
41 return v1.
x*v2.
x + v1.
y*v2.
y + v1.z*v2.z;
45 v1.
y * v2.z - v1.z*v2.
y,
46 v1.z * v2.
x - v1.
x*v2.z,
47 v1.
x * v2.
y - v1.
y*v2.
x);
53 float t = -(d+(
n^p1) )/dn;
57 return(a.
x==
b.x && a.
y==
b.y && a.z==
b.z);
62 matrix transpose(matrix m) {
63 return matrix(
Vector(m.x.x,m.y.x,m.z.x),
65 Vector(m.x.z,m.y.z,m.z.z));
69 return Vector(m.x^v,m.y^v,m.z^v);
73 return matrix(m1*m2.x,m1*m2.y,m1*m2.z);
77 Quaternion
operator*(Quaternion a,Quaternion
b) {
79 c.r = a.r*
b.r - a.x*
b.x - a.y*
b.y - a.z*
b.z;
80 c.x = a.r*
b.x + a.x*
b.r + a.y*
b.z - a.z*
b.y;
81 c.y = a.r*
b.y - a.x*
b.z + a.y*
b.r + a.z*
b.x;
82 c.z = a.r*
b.z + a.x*
b.y - a.y*
b.x + a.z*
b.r;
86 return Quaternion(q.r*-1,q.x,q.y,q.z);
89 return Quaternion(a.r*
b, a.x*
b, a.y*
b, a.z*
b);
92 return q.getmatrix() * v;
99 Quaternion
operator+(Quaternion a,Quaternion
b) {
100 return Quaternion(a.r+
b.r, a.x+
b.x, a.y+
b.y, a.z+
b.z);
103 return (a.r*
b.r + a.x*
b.x + a.y*
b.y + a.z*
b.z);
105 Quaternion
slerp(Quaternion a,Quaternion
b,
float interp){
112 float theta = float(
acos(a^
b));
113 if(theta==0.0
f) {
return(a);}
115 a*float(
sin(theta-interp*theta)/
sin(theta))
116 +
b*float(
sin(interp*theta)/
sin(theta));
quaternion slerp(const quaternion &qa, const quaternion &qb, const scalar t)
Spherical linear interpolation of quaternions.
dimensionedScalar sin(const dimensionedScalar &ds)
tmp< fvMatrix< Type > > operator-(const fvMatrix< Type > &)
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
HashSet< Key, Hash > operator^(const HashSet< Key, Hash > &hash1, const HashSet< Key, Hash > &hash2)
Create a HashSet that only contains unique entries (xor)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
tmp< fvMatrix< Type > > operator*(const DimensionedField< scalar, volMesh > &, const fvMatrix< Type > &)
Raster operator/(const Raster &rast1, const Raster &rast2)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensionedScalar acos(const dimensionedScalar &ds)
const dimensionedScalar c
Speed of light in a vacuum.
tmp< fvMatrix< Type > > operator+(const fvMatrix< Type > &, const fvMatrix< Type > &)
quaternion normalize(const quaternion &q)
Return the normalized (unit) quaternion of the given quaternion.