-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot3Drefaxis.m
34 lines (28 loc) · 694 Bytes
/
plot3Drefaxis.m
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
26
27
28
29
30
31
32
33
34
function plot3Drefaxis(K)
% PLOT3DREFAXIS Plots the referential basis defined by homogeneous transformation matrix K.
%
% Plot3dRefAxis(K) plots the 3 base vectors (x, y, z) of the
% transformation defined by HTM K in a 3D space. x and y axis are printed
% in blue; z axis is printed in red.
%
% For better visualization, axis('equal') should be enforced.
s='b';
% Stores the current hold state
holdstate=ishold;
% Draw the 3 vectors
for i=1:3
if i==3
s='r';
end
h = quiver3(K(1,4),K(2,4),K(3,4),K(1,i),K(2,i),K(3,i),s);
set(h,'Linewidth',1);
% Force hold for j and k vectors
hold on
end
% restore hold state
if holdstate==1
hold on
else
hold off
end
return;