20#ifndef _ROTATION_ABOUT_AXES_ZXZ_H_
21#define _ROTATION_ABOUT_AXES_ZXZ_H_
23#include "mbsim/functions/kinematics/rotation_about_three_axes.h"
24#include "mbsim/functions/kinematics/rotation_about_axes_zxz_mapping.h"
25#include "mbsim/functions/kinematics/rotation_about_axes_zxz_transformed_mapping.h"
31 using B = fmatvec::Function<fmatvec::RotMat3(Arg)>;
37 fmatvec::RotMat3 operator()(
const Arg &q)
override {
41 double spsi = sin(psi);
42 double stheta = sin(theta);
43 double sphi = sin(phi);
44 double cpsi = cos(psi);
45 double ctheta = cos(theta);
46 double cphi = cos(phi);
47 A.e(0,0) = cpsi*cphi-spsi*ctheta*sphi;
48 A.e(1,0) = spsi*cphi+cpsi*ctheta*sphi;
49 A.e(2,0) = stheta*sphi;
50 A.e(0,1) = -cpsi*sphi-spsi*ctheta*cphi;
51 A.e(1,1) = -spsi*sphi+cpsi*ctheta*cphi;
52 A.e(2,1) = stheta*cphi;
53 A.e(0,2) = spsi*stheta;
54 A.e(1,2) = -cpsi*stheta;
58 typename B::DRetDArg parDer(
const Arg &q)
override {
61 double sint = sin(theta);
63 Element::throwError(
"Singularity in rotation.");
64 double cosp = cos(psi);
65 double sinp = sin(psi);
71 J.e(1,2) = -cosp*sint;
74 J.e(2,2) = cos(theta);
77 typename B::DRetDArg parDerDirDer(
const Arg &qd,
const Arg &q)
override {
81 double thetad=qd.e(1);
82 double sint = sin(theta);
83 double cost = cos(theta);
84 double cosp = cos(psi);
85 double sinp = sin(psi);
86 Jd.e(0,1) = -sinp*psid;
87 Jd.e(0,2) = cosp*sint*psid + sinp*cost*thetad;
88 Jd.e(1,1) = cosp*psid;
89 Jd.e(1,2) = sinp*sint*psid - cosp*cost*thetad;
90 Jd.e(2,2) = -sint*thetad;
Definition: function.h:53
Definition: rotation_about_axes_zxz_mapping.h:28
Definition: rotation_about_axes_zxz.h:30
rotation class for rotation about three axes
Definition: rotation_about_three_axes.h:31
namespace MBSim
Definition: bilateral_constraint.cc:30