cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Sine Cosine Function
Sine Cosine Function
Dec 5, 2014 at 2:26pm UTC
newton123
(32)
Programmers i need your help. Do you know how to code sine and cosine function without using cmath library or any other related libraries. Any response will be greatly appreciated. I just don't know where to start. Thanks!
Dec 5, 2014 at 2:35pm UTC
MiiNiPaa
(8886)
1) use fsin CPU command
2) calculate Taylor series until needed precision will be met
3) Look into:
http://en.wikipedia.org/wiki/CORDIC
4) Do optimised arcane calculations:
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/ieee754/dbl-64/s_sin.c;hb=HEAD#l281
(slightly simplier version:
http://eng.upm.edu.my/~kmbs/teaching/OS/html/sin_8c.html
)
Last edited on
Dec 5, 2014 at 2:37pm UTC
Dec 5, 2014 at 4:23pm UTC
newton123
(32)
it's way too complicated. tnx anyway. it helped.
Topic archived. No new replies allowed.