Updated format of rotation for consistency with coordinate systems

This commit is contained in:
Hrvoje Jasak 2010-10-15 19:56:02 +01:00
parent 291ffd4eed
commit e15c8da28c
2 changed files with 11 additions and 3 deletions

View file

@ -32,11 +32,18 @@ License
Foam::tensor Foam::RodriguesRotation Foam::tensor Foam::RodriguesRotation
( (
const vector& rotationAxis, const vector& rotationAxis,
const scalar& rotationAngle const scalar& rotationAngle,
const bool inDegrees
) )
{ {
tensor rotTensor; tensor rotTensor;
scalar theta = rotationAngle*mathematicalConstant::pi/180.0; scalar theta = rotationAngle;
if (inDegrees)
{
theta *= mathematicalConstant::pi/180.0;
}
scalar sinTheta = sin(theta); scalar sinTheta = sin(theta);
scalar cosTheta = cos(theta); scalar cosTheta = cos(theta);
scalar oneMinusCosTheta = 1.0 - cosTheta; scalar oneMinusCosTheta = 1.0 - cosTheta;

View file

@ -53,7 +53,8 @@ namespace Foam
tensor RodriguesRotation tensor RodriguesRotation
( (
const vector& rotationAxis, const vector& rotationAxis,
const scalar& rotationAngle const scalar& rotationAngle,
const bool inDegrees = true
); );