help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

modulo 2 pi?


From: Søren Hauberg
Subject: modulo 2 pi?
Date: Wed, 21 Jan 2009 10:49:52 +0100

Hi All,

If I have two angles 'theta' and 'psi', and I want to compute their
difference I can simply do

  d = theta - psi;

However, I'd like this result to be in the range [0, 2*pi]. Can I simply
do

  d = mod (theta - psi, 2*pi);

or will this fail in some cases?

Thanks,
Søren



reply via email to

[Prev in Thread] Current Thread [Next in Thread]