Mapping Toolbox    
zero22pi

Convert normalize angles to lie between 0 and 2

Syntax

Description

anglout = zero22pi(anglin) wraps the input angle anglin to lie on the range 0 to 2 (e.g., 450° is renamed 90°).

anglout = zero22pi(anglin,units) specifies the angle units with any valid angle units string units. The default is 'degrees.

anglout = zero22pi(anglin,units,approach) specifies the approach logic for this wrapping. The approach string 'exact' calculates a mathematically precise wrap. 'inward' and 'outward' calculate more quickly by shifting the values by an epsilon either toward or away from the origin and performing a trigonometric wrap. The trigonometric wrap is inexact to allow for the fact that different computer math processors might give different (although trigonometrically identical) results (180° or -180°, for example). The offset prevents this.

Examples

See Also
npi2pi
Normalize angles to lie between - and


  zdatam zerom