Thread: Radian calculator

  1. #1
    Registered User
    Join Date
    Apr 2007

    Radian calculator

    i have to make a program to calculate sin/tan/atan in radians without using math.h

    for my for loop, is this ok?

    for(double x = 0; x <= 2*3.14; x += 0.2)

    ** this is supposed to calculate the sin/tan of a radian value from 0 to 2pi, in increments of .2

  2. #2
    Registered User
    Join Date
    Oct 2006
    does it work for you? if so then sure its ok! looks fine to me.

  3. #3
    Registered User
    Join Date
    Apr 2006
    It is better style to make 3.14 and 0.2 const variables, defined above. That way they are easy to change without looking through a lot of code.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I need help modifying my calculator!!
    By Matus in forum C Programming
    Replies: 5
    Last Post: 03-25-2008, 12:03 PM
  2. GUI Calculator - Critique
    By The Brain in forum Windows Programming
    Replies: 1
    Last Post: 02-25-2006, 04:39 AM
  3. Calculator + LinkedList
    By maro009 in forum C++ Programming
    Replies: 20
    Last Post: 05-17-2005, 12:56 PM
  4. Need help with calculator program
    By Kate in forum C# Programming
    Replies: 1
    Last Post: 01-16-2004, 10:48 AM
  5. Replies: 2
    Last Post: 05-10-2002, 04:16 PM