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

25 lines
476 B
Mathematica
Raw Permalink Normal View History

2024-12-16 16:33:21 +00:00
function S = ScrewToAxis(q, s, h)
% *** CHAPTER 3: RIGID-BODY MOTIONS ***
% Takes q: a point lying on the screw axis,
% s: a unit vector in the direction of the screw axis,
% h: the pitch of the screw axis.
% Returns the corresponding normalized screw axis.
% Example Input:
%
% clear; clc;
% q = [3; 0; 0];
% s = [0; 0; 1];
% h = 2;
% S = ScrewToAxis(q, s, h)
%
% Output:
% S =
% 0
% 0
% 1
% 0
% -3
% 2
S = [s; cross(q, s) + h * s];
end