[d164bf]: / tool_funcs / torsionProfile.m

Download this file

29 lines (19 with data), 944 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
%-------------------------------------------------------------------------%
% Copyright (c) 2021 Modenese L. %
% Author: Luca Modenese, 2021 %
% email: l.modenese@imperial.ac.uk %
% ----------------------------------------------------------------------- %
% linear between the two values given, then going to zero in the rest of
% the bone
function torsion_angle = torsionProfile(L, LengthProfilePoints, torsion_points)
torsion_points_rad = torsion_points/180*pi;
tors_grad = diff(torsion_points_rad)/diff(LengthProfilePoints);
% if L>min(LengthProfilePoints) && L<max(LengthProfilePoints)
torsion_angle = torsion_points_rad(1) + tors_grad * L;
% else
% torsion_angle = 0;
% end
% plot(LengthProfilePoints', torsion_points, 'r-')
% xlabel('Lenght of the bone [m]')
% ylabel('Torsion Angle [deg]')
end