dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: "sin" is magic. I hate magic.

  1. #1
    Epicurean Love Toy
    Join Date
    Nov 2003
    Location
    Santa Monica, CA
    Posts
    171

    "sin" is magic. I hate magic.

    I know how to use sin and cos, but what I dont know is how they work.

    To me they are magic processes, can someone explain how they work - in an effort to make them seem less magical to me?

    crack open the black box of the Math.sin function if you will.


    Thankyou!

  2. #2
    Senior Member jbum's Avatar
    Join Date
    Feb 2004
    Location
    Los Angeles
    Posts
    2,920
    My experience with sine started with analog synthesizers, in which they were used to make music. I treated them as magic (useful magic) for years before I found out more about them. Although I don't like magic either, I think it helps to have played with sin/cos a bit (as you have) before having them fully explained.

    I suspect a lot of trigonometry students are at a loss to understand sin/cos, because they don't get a chance to play with them, in the way that we do.

    I wrote the following movie to help you get a more intuitive understanding of what they're about.

    Basically, sin describes the relationship between one side of a right triangle and the hypoteneuse (the long side). Cos describes the relationship between the other side of the same right triangle and the hypoteneuse.

    The movie demonstrates why they work to draw circles.

    Sine/Cosine Movie

    The Source Code

    Play with the movie a while, perhaps in a separate window, before continuing.

    When you view the movie, use the mouse to guide the triangle around the circle. As you go around, note the relationship between the blue line (sine) and the blue sine wave in the diagram.

    Note the relationship between the green line and the green cosine waveform in the diagram.

    The hypotenuse of the triangle is at an angle that corresponds to the angle that is being passed to sin/cos. The black line in the waveform diagram corresponds to that angle.

    So sin(angle_of_hypoteneuse) gives us the length of the blue line if the hypoteneuse is 1.

    So cos(angle_of_hypoteneuse) gives us the length of the green line if the hypoteneuse is 1.

    When the hypoteneuse is 1, the perimeter of the circle has a length of 2*PI. This is why the angular units passed to sin and cos go from 0 to 2*PI.
    Last edited by jbum; 04-27-2004 at 03:37 AM.

  3. #3
    Chief of Molecules wcoleman's Avatar
    Join Date
    Nov 2000
    Location
    Massachusetts
    Posts
    3,975
    And if you want to explore the relationships among the various trig functions in more detail here is another example.

    Cheers,

    Flick

  4. #4
    Junior Member
    Join Date
    Jun 2004
    Posts
    13
    this is sick...but useful
    paranoia's all i got left...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center