Shop OBEX P1 Docs P2 Docs Learn Events
Trig object Spin/Pasm — Parallax Forums

Trig object Spin/Pasm

I am looking for an object written in Spin or Pasm to perform trig functions. I would like something which interfaces like this:
var := Trig.sin(12)
var2 := Trig.cos(34)
I need sine, cosine, tangent, and the inverses.

Comments

  • I am looking for an object written in Spin or Pasm to perform trig functions. I would like something which interfaces like this:
    var := Trig.sin(12)
    var2 := Trig.cos(34)
    
    I need sine, cosine, tangent, and the inverses.

    What about this one from the Object Exchange: http://obex.parallax.com/object/609

    You didn't say if you needed floating point or just integer results, the object above returns integer results.

    There is also this one, that does fixed point math: http://obex.parallax.com/object/232

  • Preferred decimals, but integers would work in many situations. I think that a lot of motor drivers would use integer.
Sign In or Register to comment.