I have to calculate a force vector in a different frame. There are 3 distinct frame Local Sensor and Body frame the all of body and sensor frame are expressed on local frame by these vectors:
$S_{x}^{L} \begin{bmatrix} 1.3343\\ -0.7704\\ -0.7185 \end{bmatrix}$ $S_{y}^{L} \begin{bmatrix} 0.7925\\ 1.4979\\ -0.1343 \end{bmatrix}$ $S_{z}^{L} \begin{bmatrix} 0.6939\\ -0.2295\\ 1.539 \end{bmatrix}$ $B_{x}^{L} \begin{bmatrix} 1.4793\\ -1.4793\\ 0.1830 \end{bmatrix}$ $B_{y}^{L} \begin{bmatrix} 1.4399\\ 1.4848\\ 0.3633 \end{bmatrix}$
$B_{z}^{L} \begin{bmatrix} -0.3853\\ -0.1304\\ 2.0602 \end{bmatrix}$ $f_{s} \begin{bmatrix} -0.1\\ 0.05\\ -9.79 \end{bmatrix}$
i tried to figure out the different algorithm that are described in this article Calculate Rotation Matrix to align Vector A to Vector B in 3d?
Edit : i used this script to calculate the rotation matrix from the $B_{x}^{L} $ to $ S_{x}^{L} $
close all
clear
clc
v1=[1.3343 -0.7704 -0.7185]';
v2=[1.4793 -1.4793 0.1830]';
dcm= fcn_RotationFromTwoVectors(v1, v2)
c=dcm*v1
function R=fcn_RotationFromTwoVectors(v1, v2)
% R*v1=v2
% v1 and v2 should be column vectors and 3x1
% 1. rotation vector
w=cross(v1,v2);
w=w/norm(w);
w_hat=fcn_GetSkew(w);
% 2. rotation angle
cos_tht=v1'v2/norm(v1)/norm(v2);
tht=acos(cos_tht);
% 3. rotation matrix, using Rodrigues' formula
R=eye(size(v1,1))+w_hatsin(tht)+w_hat^2*(1-cos(tht));
end
function x_skew=fcn_GetSkew(x)
x_skew=[0 -x(3) x(2);
x(3) 0 -x(1);
-x(2) x(1) 0];
end
t tried to calculate if the resultant vector of rotated $ S_{x}^{L} $ but that didn't match the value of $ B_{x}^{L} $ . in my approach i won't to calculate in first step the different DCM matrix to rotate over different frame L S B to be able to calculate the force vector in this frame