The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.