File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 195195 v = formula(v );
196196 end
197197 n = norm([s ; v(: )]);
198+ if s < 0
199+ % enforce non-negative scalar
200+ s = - s ;
201+ v = - v ;
202+ end
198203 uq.s = s / n ;
199204 uq.v = v / n ;
200205 elseif isvec(s ,4 )
203208 if ~isa(s , ' sym' )
204209 s = unit(s );
205210 end
211+ if s(1 ) < 0
212+ % enforce non-negative scalar
213+ s = - s ;
214+ end
206215 uq.s = s(1 );
207216 uq.v = s(2 : 4 );
208217 else
@@ -1189,6 +1198,7 @@ function animate(Q, varargin)
11891198 uq = UnitQuaternion(s , qv );
11901199 end
11911200
1201+
11921202% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11931203% %%% OTHER STATIC METHODS, ALTERNATIVE CONSTRUCTORS
11941204% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
You can’t perform that action at this time.
0 commit comments