Python Forum
How do I get the tangent of a degree
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I get the tangent of a degree
#3
(Oct-24-2019, 01:33 AM)SheeppOSU Wrote: I was trying to get the tangent of a degree, but math.tan returns the radian


math.tan(x) doesn't return radians (it returns value of tangent for specific angle -- x which is (expected to be) given in radians). math.atan is inverse function to math.tan, therefore, it returns radians. So, math.tan(x) requires x to be in radians. If you want to calculate, e.g. tan(60 degrees), you need to convert 60 degrees to radians: tan(60 degrees) = math.tan(math.radians(60)). Note, that conversion between radians and degrees is very simple: math.radians(deg) = deg * math.pi / 180.0.
Reply


Messages In This Thread
How do I get the tangent of a degree - by SheeppOSU - Oct-24-2019, 01:33 AM
RE: How do I get the tangent of a degree - by scidam - Oct-24-2019, 03:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to map 360 degree angle over 1024 counts breadcat248 3 2,617 May-17-2019, 07:13 AM
Last Post: breadcat248
  Python function to get colorwheel RGB values from compass degree? wrybread 5 8,418 Sep-06-2017, 05:36 PM
Last Post: wrybread

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020