by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analytical Geometry
Introduced first in SolidGeometry 5.1, Creation date: 2021-12-14, Last change: 2025-09-15
See Also: isincirclesegment
, CPLcrosscircseg
, cplot
, angleinterv
, circlesegmentofPL
AL=angleshift(AL,[ival])
AL: | List of angle values | |
ival: | [-pi..+pi] or [0 2*pi]; or [ival ival+2*pi]; default is [0 2*pi] |
AL: | Alle values inside the allowed interval |
AL=rand(10,2)*3*pi,
angleshift(AL)
angleshift(AL,[pi +pi) % [-pi ... pi]
angleshift(AL,[0 2*pi]) % [0 ...2*pi]
angleshift(AL,2) % [2 ... 2+2*pi]
This function, angleshift, is designed to shift angle values into a specified interval. It is part of the SolidGeometry library and was introduced in version 5.1.
AL in ALorg.ival using the function getfuncparams. If ival is a single value, extend it to a full interval by adding 2*pi.AL:
ival, add 2*pi until it falls within the interval.ival, subtract 2*pi until it falls within the interval.nargout==0), print a debug message showing the interval and display a table comparing original and new angle values.AL = rand(10,2) * 3 * pi; angleshift(AL); angleshift(AL, [-pi +pi]); % Shifts angles to [-pi ... pi] angleshift(AL, [0 2*pi]); % Shifts angles to [0 ... 2*pi] angleshift(AL, 2); % Shifts angles to [2 ... 2+2*pi]Algorithm explaination created using ChatGPT on 2025-08-19 01:17. (Please note: No guarantee for the correctness of this explanation)