Tudat/Mathematics/BasicMathematics/rotationAboutArbitraryAxis.cpp
//! Compute rotation of vector about arbitrary axis
Compute rotation of vector about arbitrary axis
Compute rotation of vector about arbitrary axis
Eigen::Vector3d computeRotationOfVectorAboutArbitraryAxis(
        const Eigen::Vector3d& originOfRotation,
        const double angleOfRotation,
        const Eigen::Vector3d& axisOfRotation,
        const Eigen::Vector3d& initialPositionOfVectorTail,
        const Eigen::Vector3d& initialVector )
{
    Eigen::Vector3d rotatedPositionOfVectorTail =
            computeRotationOfPointAboutArbitraryAxis( originOfRotation, angleOfRotation,
                                                      axisOfRotation, initialPositionOfVectorTail );
    Eigen::Vector3d rotatedPositionOfVectorHead =
            computeRotationOfPointAboutArbitraryAxis( originOfRotation, angleOfRotation,
                                                      axisOfRotation,
                                                      initialPositionOfVectorTail + initialVector );
    return rotatedPositionOfVectorHead - rotatedPositionOfVectorTail;
}
Eigen :: Vector3d computeRotationOfVectorAboutArbitraryAxis ( const Eigen :: Vector3d & originOfRotation , const double angleOfRotation , const Eigen :: Vector3d & axisOfRotation , const Eigen :: Vector3d & initialPositionOfVectorTail , const Eigen :: Vector3d & initialVector ) { Eigen :: Vector3d rotatedPositionOfVectorTail = computeRotationOfPointAboutArbitraryAxis ( originOfRotation , angleOfRotation , axisOfRotation , initialPositionOfVectorTail ) ; Eigen :: Vector3d rotatedPositionOfVectorHead = computeRotationOfPointAboutArbitraryAxis ( originOfRotation , angleOfRotation , axisOfRotation , initialPositionOfVectorTail + initialVector ) ; return rotatedPositionOfVectorHead - rotatedPositionOfVectorTail ; }
Compute rotation of vector about arbitrary axis
Compute rotation of vector about arbitrary axis
// Compute rotation of the tail of vector. Resulted position is with respect to the chosen // arbitrary origin. // Compute rotation of the head of vector. Resulted position is with respect to the chosen // arbitrary origin. // Return rotated vector with respect to the chosen arbitrary origin