Jul 22, 2005 arctan of complex number. C / C Forums on Bytes. Marc Schellens wrote: Does anybody know an easy way to get the atan of a complex number in C? Mar 24, 2013 In this program we will look the math library and trig functions. Please suscribe to the videos on this playlist at http://www.youtube.com/playlist?list=PLTn.
In the C Programming Language, the atan function returns the arc tangent of x.
Syntax
The syntax for the atan function in the C Language is:
Parameters or Arguments
- x
- The value used to calculate the arc tangent.
Returns
![Dev C++ Arctan Dev C++ Arctan](/uploads/1/2/6/2/126213900/345359993.png)
The atan function returns the arc tangent of a number represented by x. It will return a value between -π/2 and π/2.
Required Header
In the C Language, the required header for the atan function is:
Applies To
In the C Language, the atan function can be used in the following versions:
- ANSI/ISO 9899-1990
![C++ C++](/uploads/1/2/6/2/126213900/477029615.jpg)
atan Example
When compiled and run, this application will output:
Arctan Function C
Similar Functions
Arctan Is The Same As
Other C functions that are similar to the atan function:
Hi everyone,
I am taking a C++ 100 level beginners course and we just got this assgnment that I am stuck on. Here is the assginment description:
We are going to just compute the first 15 or so digits of π using doubles.
In any case, to compute the value of π, we need a formula for it. Let’s use the standard formula,
π = 16arctan(1/5) - 4arctan(1/239)
Dev C++ 5.11
This is all well and good, but in order to compute π, we need to compute arctan now. We could try to use a standard function from cmath, but let’s write our own function to compute arctan. Mathematicians tell us an easy formula to use is
arctan(x) = x - x^3/3 + x^5/5 - x^7/7 + x^9/9 - ...
The only parts that might need some thinking are the alternating signs, and the fact that the exponents and denominators both increment by 2.
Here is a sample output from the program:
Pi = 3.14159265358
Press any key to continue
In class, the professor told us to compare it to the programs we worked on to compute sin(x) and e^x. I have been referring to those programs I have but I still can't seem to solve it. Here is what I have so far:
- 3 Contributors
- forum 5 Replies
- 623 Views
- 3 Days Discussion Span
- commentLatest Postby WaltPLatest Post
WaltP2,905
1) Why calculate the denom and power values from scratch each time? Just add 2 each time through the loop.
2) How does
sign*power/denom;
equate to x^5/5
? Where's your x? Where's x^5?