Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Math Forum » Discussions » sci.math.* » sci.math.num-analysis.independent

Topic: locate value within period
Replies: 3   Last Post: Aug 31, 2010 12:19 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 9
Registered: 1/2/09
locate value within period
Posted: Aug 31, 2010 3:17 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


Given a value of theta, I need to add or subtract integer multiples of 2 pi, so that the value lies in [0, 2pi). I tried something like:

n = int(theta/(2 Pi)


theta = theta - n*2*pi

but that does not work in all cases. What is the best way to do this ?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2015. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.