On Thu, 12 Apr 2001 18:01:43 -0600, Mitch Chapman <chapman at bioreason.com> wrote: >Mark Rowe wrote: >> Just been reading through the Math modules documentation and i can't see any >> way to find the inverse tangent of a number.... I know that this is >> possible, but how? > >>>> import math >>>> math.pi/4.0 >0.785398163397 >>>> math.atan(1.0) >0.785398163397 >>>> math.atan2(1.0, 1.0) >0.785398163397 Also use atan2(y,x) to get the angle from -pi < theta < pi whereas if you use atan you'll only get -pi/2 < result < pi/2 which will _not_ be the same as the real angle. eg) >>> math.atan2(-10,-10)*180/math.pi -135.0
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4