Shop OBEX P1 Docs P2 Docs Learn Events
ARCTAN F32 object — Parallax Forums

ARCTAN F32 object

BitsBits Posts: 414
edited 2012-08-01 13:08 in Propeller 1
What am I doing wrong? I am using the F32 object and simply want to get the Tan ˉ¹(1) or better yet Ө = Tanˉ¹m

Pub ArcTan
      return Math.ATan(1.0) 


I was expecting 45.0 but getting .79?

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-08-01 11:27
    It returns radians.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2012-08-01 11:33
    2 * pi radians in a circle, 360 degrees, one radian is 57.3 degrees.
  • BitsBits Posts: 414
    edited 2012-08-01 11:40
    AHHHHHHHH!!

    Thanks, I guess I need to read the comments further.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-08-01 11:50
    Bits,

    Make sure and check out the Arctan2 method. With Arctan2 you give it two parameters (X and Y) and it outputs the angle of those points from zero.

    In most of my arctangent applications, I need to know the angle within a full circle not just one quadrant. Arctan2 does just this.
  • BitsBits Posts: 414
    edited 2012-08-01 13:08
    Thanks Duane.

    I have a dynamic slope that I simply want to convert it to angle. Ill keep at it.
Sign In or Register to comment.