English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I need the formulas for calculating log, Exp and atans when all I have available to me is the sin, cos, tan functions. The backstory is that I am porting source code from a language that has a full Math library to a language that only offers sin, cos and tan. Thanks.

2006-12-03 20:49:08 · 2 answers · asked by cmh 1 in Science & Mathematics Mathematics

2 answers

That's pretty tricky, since the only relationship between the exponential-related functions and the trigonometric functions is this formula:

e^(ix) = cos(x) + i * sin(x)

where i = sqrt(-1)

That's about the only help I can provide, and I hope someone has a better answer as I'm curious myself how to express e^ and log as a function of sin, cos, and tan.

2006-12-03 21:04:58 · answer #1 · answered by Puggy 7 · 0 0

I don't see how sin, cos, tan help you.

If there is a "full math library", hasn't your problem been solved for you?

However, look up "Taylor Series". There is an infinite series of polynomial terms for most common continuous functions. For example,

exp(x) = 1 + x + (x^2)/2! + (x^3)/3! + and so on, and you can calculate an excellent approximation by taking enough terms.

2006-12-04 00:12:37 · answer #2 · answered by fcas80 7 · 0 0

fedest.com, questions and answers