IRDYn/complie/R1000 DVT GravityModel V1/mr/so3ToVec.m

18 lines
398 B
Mathematica
Raw Permalink Normal View History

2024-12-16 16:33:21 +00:00
function omg = so3ToVec(so3mat)
% *** CHAPTER 3: RIGID-BODY MOTIONS ***
% Takes a 3x3 skew-symmetric matrix (an element of so(3)).
% Returns the corresponding 3-vector (angular velocity).
% Example Input:
%
% clear; clc;
% so3mat = [[0, -3, 2]; [3, 0, -1]; [-2, 1, 0]];
% omg = so3ToVec(so3mat)
%
% Output:
% omg =
% 1
% 2
% 3
omg = [so3mat(3, 2); so3mat(1, 3); so3mat(2, 1)];
end