Thread: Trigonometry problem

  1. #1
    Registered User
    Join Date
    Jul 2004

    Trigonometry problem


    I'm having a small problem with doing calculations with the sin(), cos(), and tan() functions. When I output the value of sin(45), I expect that I get the value of 0.70710678118654752440084436210485, but I get something else. Same is with the tan() and cos() functions. Either I'm not using the right type of functions or I'm supposed to convert some numbers to radians, or something.

    What is it?
    Last edited by McYaballow; 07-09-2004 at 01:08 AM.

  2. #2
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Ontario, Canada
    You have to convert to radians first. To do that, you just need to multiply the number by M_PI / 180.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  3. #3
    Registered User
    Join Date
    Jul 2004
    Thanks, i'll try that.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM