Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: √ ∞ ≠ ≤ ≥ ≈ ⇒ ∈ Δ θ ∴ ∑ ∫ π -

Login

Username

Password

Not registered yet?

  • Index
  •  » Help Me !
  •  » I need sine, cosine and tangent functions for C++ :-(

Post a reply

Go back

Write your message and submit
:) :| :( :D :o ;) :/ :P :lol: :mad: :rolleyes: :cool: | :dizzy :eek :kiss :roflol :rolleyes :shame :down :up :touched :sleep :wave :swear :tongue :what :faint :dunno
Options

Go back

Topic review (newest first)

mikau
2005-10-05 11:23:55

Hey it works! Thanks again mathisfun! Are there functions for arcsin, arccos, and arctan?

mikau
2005-10-05 11:16:37

wow, sometimes please does work!

mikau
2005-10-05 10:56:58

Thats exactly what I'm looking for! :-D Thanks a yotta, Mathisfun!

MathsIsFun
2005-10-03 08:42:31

For performance I would use the standard include "math.h" - it has sin cos and tan.

Example:

#include <stdio.h>
#include <math.h>

#define PI 3.141592654

int main () {
  double angle;
  angle = 10;
  double ans;
  ans = sin (angle*PI/180);
  printf ("Ans = %lf ", ans );
  return 0;
}

Or did you need more accuracy or something?

mikau
2005-10-03 05:14:47

please?

mikau
2005-10-01 13:14:25

I'm writing some awsome programs using math but I really really really need access to sine, cosine and tangent functions, also I really could use arcsin, arccos, and arctan, but arctangent the most since I need to convert from rectangular form to polar form and back.

Someone gave me a link to the formulas for sine, cosine and tangent, which was great and they appear to work, but they call a lot of factorials and very large numbers "270^5" :-O

If anyone knows where I can get a copy of the source code for functions for sine, cosine, tangent, arcsine, etc. so I can just copy the definition into my program and call on it when I need it. It would be a MAJOR help!

Board footer

Powered by FluxBB