From 451e46adbdca2254f667dcab4344851422556e9c Mon Sep 17 00:00:00 2001 From: Ralf Hielscher Date: Thu, 7 Nov 2024 12:32:08 +0100 Subject: [PATCH] better circles :) --- geometry/@vector3d/circle.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/geometry/@vector3d/circle.m b/geometry/@vector3d/circle.m index 112bacb82..dcbd108e9 100644 --- a/geometry/@vector3d/circle.m +++ b/geometry/@vector3d/circle.m @@ -21,18 +21,21 @@ omega = 90*degree; end -h = []; +if isscalar(normals), normals = repmat(normals,size(omega)); end +if isscalar(omega), omega = repmat(omega,size(normals)); end + +h = gobjects; for i = 1:length(normals) n = normals.subSet(i); % generate circles - c = axis2quat(n,(0:1:360)*degree) * axis2quat(orth(n),omega)*n; + c = axis2quat(n,(0:1:360)*degree) * axis2quat(orth(n),omega(i))*n; % plot circles h = [h,line(c,varargin{:},'hold','doNotDraw')]; %#ok end -if nargout == 0, clear h;end +if nargout == 0, clear h; end