Shop OBEX P1 Docs P2 Docs Learn Events
trig functions — Parallax Forums

trig functions

RS_JimRS_Jim Posts: 1,771
edited 2009-01-06 13:59 in General Discussion
Hi, Does anyone know of any available trig functions for the SX in SXB or asm such as ARCSIN,ARCCOS and ARCTAN?· I have a little project that I would like to try if those functions are available. I checked out the libraries but did not find what I was looking for.
Thanks
Jim

Comments

  • JonnyMacJonnyMac Posts: 9,214
    edited 2009-01-04 15:41
    I've only evern done SIN and COS functions to duplicate those in the BS2. You should be able to use these with the the math on Dr. Tray Allen's site to get what you need.

    www.emesystems.com/BS2math3.htm
  • RS_JimRS_Jim Posts: 1,771
    edited 2009-01-05 13:10
    Thanks Jonny, It never occured to me to use a look up table.· I wonder if that is the way that the BS2 derives sin/cos?
    Thanks again, your support of this forum is awesome!
    Jim
  • BeanBean Posts: 8,129
    edited 2009-01-05 17:53
    Jim,
    The BS2 uses CORDIC to compute SIN,COS,ATN, and HYP.

    I have used CORDIC to compute ATN and HYP. If you would like to see it, I'll see if I can dig it up. Let me know.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ·The next time you need a hero don't look up in the sky...Look in the mirror.


    ·
  • ZootZoot Posts: 2,227
    edited 2009-01-05 21:56
    Bean, I think this is your code for CORDIC ATAN (but I can't remember if sin/cos were lookup tables) ----

    http://forums.parallax.com/showthread.php?p=620457, about halfway down the page.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • BeanBean Posts: 8,129
    edited 2009-01-05 23:07
    Zoot,
    Yep that's it.
    Thanks for digging it up.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ·The next time you need a hero don't look up in the sky...Look in the mirror.


    ·
  • RS_JimRS_Jim Posts: 1,771
    edited 2009-01-06 13:59
    Thanks Zoot and Bean, I had seen tracy's stuff about Cordic and was courious.
    Jim
Sign In or Register to comment.