Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. sine and cosine

sine and cosine

Scheduled Pinned Locked Moved The Lounge
question
10 Posts 10 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jamie Nordmeyer
    wrote on last edited by
    #1

    How are they calculated? I remember from school that it has to do with the distance from the center of a circle, but don't recall exactly how it was done. Not trying to implement them by any means (99.99% of all language libraries already do), I'm just curious. Jamie Nordmeyer Portland, Oregon, USA

    E M P J C 5 Replies Last reply
    0
    • J Jamie Nordmeyer

      How are they calculated? I remember from school that it has to do with the distance from the center of a circle, but don't recall exactly how it was done. Not trying to implement them by any means (99.99% of all language libraries already do), I'm just curious. Jamie Nordmeyer Portland, Oregon, USA

      E Offline
      E Offline
      Eric Astor
      wrote on last edited by
      #2

      Distance from the center of a circle has something to do with it. First, one quick definition: Unit circle - circle centered at the origin with a radius of 1. From here, sine and cosine can be defined relatively simply. Starting from the point on the positive X axis (1, 0), move along the circle by the angle specified as the argument to sine or cosine. For sine, use the y-coordinate of the new point, and use the x-coordinate for cosine.

      1 Reply Last reply
      0
      • J Jamie Nordmeyer

        How are they calculated? I remember from school that it has to do with the distance from the center of a circle, but don't recall exactly how it was done. Not trying to implement them by any means (99.99% of all language libraries already do), I'm just curious. Jamie Nordmeyer Portland, Oregon, USA

        M Offline
        M Offline
        Malibu
        wrote on last edited by
        #3

        sin(x) = x - x^3/3! + x^5/5! - x^7/7! + x^9/9! - ... cos(x) = 1 - x^2/2! + x^4/4! - x^6/6! + x^8/8! - ...

        G 1 Reply Last reply
        0
        • J Jamie Nordmeyer

          How are they calculated? I remember from school that it has to do with the distance from the center of a circle, but don't recall exactly how it was done. Not trying to implement them by any means (99.99% of all language libraries already do), I'm just curious. Jamie Nordmeyer Portland, Oregon, USA

          P Offline
          P Offline
          Paul M Watt
          wrote on last edited by
          #4

          I found this on DrMath.com http://mathforum.org/library/drmath/view/54012.html[^] Have fun :)


          Build a man a fire, and he will be warm for a day
          Light a man on fire, and he will be warm for the rest of his life!

          1 Reply Last reply
          0
          • J Jamie Nordmeyer

            How are they calculated? I remember from school that it has to do with the distance from the center of a circle, but don't recall exactly how it was done. Not trying to implement them by any means (99.99% of all language libraries already do), I'm just curious. Jamie Nordmeyer Portland, Oregon, USA

            J Offline
            J Offline
            Jamie Hale
            wrote on last edited by
            #5

            From highschool math, SOHCAHTOA. That is, considering this triangle:

                       /|
                      / |
                     /  |
                h   /   |
                   /    | o
                  /     |
                 /      |
                / q     |
                ---------
                    a
            

            where: q = the angle h = the length of the hypoteneuse (sp?) o = the length of the side opposite the angle a = the length of the side adjacent to the angle then: sin q = o / h cos q = a / h tan q = o / a They're just a bunch of ratios. J

            May the bear never have cause to eat you.

            A 1 Reply Last reply
            0
            • J Jamie Hale

              From highschool math, SOHCAHTOA. That is, considering this triangle:

                         /|
                        / |
                       /  |
                  h   /   |
                     /    | o
                    /     |
                   /      |
                  / q     |
                  ---------
                      a
              

              where: q = the angle h = the length of the hypoteneuse (sp?) o = the length of the side opposite the angle a = the length of the side adjacent to the angle then: sin q = o / h cos q = a / h tan q = o / a They're just a bunch of ratios. J

              May the bear never have cause to eat you.

              A Offline
              A Offline
              Alvaro Mendez
              wrote on last edited by
              #6

              Nicely illustrated! This brings back memory of Geometry Trigonometry... good old SOHCAHTOA :-). Regards, Alvaro


              Well done is better than well said. -- Benjamin Franklin (I actually prefer medium-well.)

              M 1 Reply Last reply
              0
              • A Alvaro Mendez

                Nicely illustrated! This brings back memory of Geometry Trigonometry... good old SOHCAHTOA :-). Regards, Alvaro


                Well done is better than well said. -- Benjamin Franklin (I actually prefer medium-well.)

                M Offline
                M Offline
                Michael Dunn
                wrote on last edited by
                #7

                Alvaro Mendez wrote: good old SOHCAHTOA Heh, that reminds me of this one girl I knew back in high school. She could never remember SOHCAHTOA right, so she'd start off a trig problem by writing SAHTOHCOA or some other odd permuatation of the letters. ;) --Mike-- Friday's GoogleFight results: Britney Spears 2,190,000 - Erica Weichers 23 :( 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

                A 1 Reply Last reply
                0
                • J Jamie Nordmeyer

                  How are they calculated? I remember from school that it has to do with the distance from the center of a circle, but don't recall exactly how it was done. Not trying to implement them by any means (99.99% of all language libraries already do), I'm just curious. Jamie Nordmeyer Portland, Oregon, USA

                  C Offline
                  C Offline
                  ColinDavies
                  wrote on last edited by
                  #8

                  Jamie Nordmeyer wrote: How are they calculated? With a few exceptions they can't be numerically calculated only aproximated. All the only approximations I have seen for them are really just variants of approximating Pi. Regardz Colin J Davies

                  Sonork ID 100.9197:Colin

                  You are the intrepid one, always willing to leap into the fray! A serious character flaw, I might add, but entertaining. Said by Roger Wright about me.

                  1 Reply Last reply
                  0
                  • M Malibu

                    sin(x) = x - x^3/3! + x^5/5! - x^7/7! + x^9/9! - ... cos(x) = 1 - x^2/2! + x^4/4! - x^6/6! + x^8/8! - ...

                    G Offline
                    G Offline
                    Gary R Wheeler
                    wrote on last edited by
                    #9

                    x being specified in radians, of course...


                    Software Zen: delete this;

                    1 Reply Last reply
                    0
                    • M Michael Dunn

                      Alvaro Mendez wrote: good old SOHCAHTOA Heh, that reminds me of this one girl I knew back in high school. She could never remember SOHCAHTOA right, so she'd start off a trig problem by writing SAHTOHCOA or some other odd permuatation of the letters. ;) --Mike-- Friday's GoogleFight results: Britney Spears 2,190,000 - Erica Weichers 23 :( 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

                      A Offline
                      A Offline
                      Andrew Peace
                      wrote on last edited by
                      #10

                      Sounds like someone really special, Mike ;)....... I used to use "Silly old Harry, caught all herring, trauling off America" back when I was knee high :). -- Andrew.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups