Skip Navigation

what are the operations of the six main trig functions

sorry for my layman terminology, but to my understanding as a coder a function has a name, parameters, arguments and operations. if sin is the name, and its parameters are side opposite and hypotenuse, and its arguments are context dependent, what is the operation itself? am i making sense?

def sin (hypotenuse, opposite):
     ??!?!?!!?
14

You're viewing a single thread.

14 comments
  • I didn't get what you were asking until I started to answer. The parameter is the angle. The algorithm is https://en.wikipedia.org/wiki/CORDIC . In (most?) compiled languages, this algorithm is performed on hardware. In (some?) interpreted languages, it's done in hardware.

    • whats the difference between an algorhythm and a function

      • An algorithm is the meat of a function. It's the "how."

        And if you're using someone else's function, you won't touch the "how" because you'll be interacting with the "what." (You use a function for what it does.)

        You will be creating your own algorithm by writing code, however. Because an algorithm is just a sequence of steps that, taken together, constitute an attempt at achieving an objective.

        Haus is saying all the little steps that go into approximating sine occur directly on the hardware.

14 comments