angularDifference.m
The calculation of the difference between two angles a and b, i.e., subtraction on the circle, is not entirely trivial because the circle is a closed manifold. For this operation to be well defined, a "cut" must be made so that the circle is "opened". One can then require that the interval between b and a cannot cross this cut.
Example 1: a = pi/2, b=0, cut=pi. Then
a-b = pi/2
b-a = -pi/2
Example 2: a = pi/2, b=0, cut=pi/4. Then
a-b = -3*pi/2
b-a = 3*pi/2.
For many applications one is typically concerned about small deviations from 0, and in such cases the obvious cut would be pi. But sometimes the cut must be elsewhere.
Cite As
Edmund Brekke (2024). angularDifference.m (https://www.mathworks.com/matlabcentral/fileexchange/46612-angulardifference-m), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- Image Processing and Computer Vision > Image Processing Toolbox > Geometric Transformation and Image Registration >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |