I am basically looking for formulae that calculate trigonometric functions (both geometric and circular), because I want to write my own math functions for my game engine. I have found some that seem to use imaginary numbers, but I don't know how to represent those in c++.
|
If you can compute sin and cos, you will get the rest. If $x$ is a real number you can find a real number $y\in[0,\pi/4]$ so that $y = \pm(\hbox{sin or cos})(x)$. In this interval the Taylor series for sine or cosine converge very fast. Now compute that and use the remainder theorem. |
|||||||
|
|
In addition to sin and cos, you also need the inverse tan - the inverse sin and cos can be gotten from this. My recommendation is to initially write your program using the standard library functions. While doing this, you can, on the side and in parallel, look at how the functions are computed and try to write your own versions. Do not let this side project prevent you from finishing the main project on time (I have been hurt in the past when this happened.) Once your program is working and you have your own functions written, substitute yours for the standard functions and see what happens. This may be instructive. |
|||
|
|

std::complex<double>. Are you sure you don't want to use the standard library functions for computing trig functions? – Hurkyl Mar 6 at 1:38