This is where navigation should be.

MODCENT - Centered modulo

Usage

y=modcent(x,r);

Description

modcent(x,r) computes the modulo of x in the range \([-r/2,r/2[\).

As an example, to compute the modulo of x in the range \([-\pi,\pi[\) use the call:

y = modcent(x,2*pi);