20 #ifndef _ROTATION_ABOUT_FIXED_AXIS_H_
21 #define _ROTATION_ABOUT_FIXED_AXIS_H_
23 #include "mbsim/functions/function.h"
24 #include "mbsim/utils/utils.h"
37 int getArgSize()
const override {
return 1; }
38 fmatvec::RotMat3 operator()(
const Arg &q)
override {
40 const double cosq=cos(alpha);
41 const double sinq=sin(alpha);
42 const double onemcosq=1-cosq;
43 const double a0a1=a.e(0)*a.e(1);
44 const double a0a2=a.e(0)*a.e(2);
45 const double a1a2=a.e(1)*a.e(2);
46 A.e(0,0) = cosq+onemcosq*a.e(0)*a.e(0);
47 A.e(1,0) = onemcosq*a0a1+a.e(2)*sinq;
48 A.e(2,0) = onemcosq*a0a2-a.e(1)*sinq;
49 A.e(0,1) = onemcosq*a0a1-a.e(2)*sinq;
50 A.e(1,1) = cosq+onemcosq*a.e(1)*a.e(1);
51 A.e(2,1) = onemcosq*a1a2+a.e(0)*sinq;
52 A.e(0,2) = onemcosq*a0a2+a.e(1)*sinq;
53 A.e(1,2) = onemcosq*a1a2-a.e(0)*sinq;
54 A.e(2,2) = cosq+onemcosq*a.e(2)*a.e(2);
57 typename B::DRetDArg parDer(
const Arg &q)
override {
return a; }
58 typename B::DRetDArg parDerDirDer(
const Arg &qd,
const Arg &q)
override {
return typename B::DRetDArg(1); }
59 typename B::DDRetDDArg parDerParDer(
const Arg &arg)
override { this->throwError(
"parDerParDer is not available for given template parameters."); }
60 bool constParDer()
const override {
return true; }
61 const fmatvec::Vec3& getAxisOfRotation()
const {
return a; }
62 void setAxisOfRotation(
const fmatvec::Vec3 &a_) { a = a_; }
63 void initializeUsingXML(xercesc::DOMElement *element)
override {
64 xercesc::DOMElement *e=MBXMLUtils::E(element)->getFirstElementChildNamed(MBSIM%
"axisOfRotation");
Definition: rotation_about_fixed_axis.h:29
Definition: planar_contour.h:30