CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

who can understand the c of atan(); ??? pls help

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
lanyong



Joined: 14 Jan 2004
Posts: 9
Location: Xiamen,Fujian Province, China

View user's profile Send private message Send e-mail ICQ Number

who can understand the c of atan(); ??? pls help
PostPosted: Wed Feb 18, 2004 6:34 pm     Reply with quote

float const pat[4]={0.17630401, 5.6710795, 22.376096, 19.818457};
float const qat[4]={1.0000000, 11.368190, 28.982246, 19.818457};




float atan(float x)
{
float y,res,r;
int s,flag;
s=0; flag=0; y=x;
if (x < 0) { s=1; y=-y;}
if (y > 1.0) { y=1.0/y; flag=1; }
res = pat[0]*y*y + pat[1];
res = res*y*y + pat[2];
res = res*y*y + pat[3];
r = qat[0]*y*y + qat[1];
r = r*y*y + qat[2];
r = r*y*y + qat[3];
res = y*res/r;
if (flag) res = 1.57079633 - res; // for |x| > 1
if (s) res = -res;
return(res);
}
_________________
Lan Yong
troky



Joined: 14 Dec 2003
Posts: 6

View user's profile Send private message

PostPosted: Thu Feb 19, 2004 6:16 pm     Reply with quote

It is based on Taylor series polynomial approximation... pure math.


Troky
lanyong



Joined: 14 Jan 2004
Posts: 9
Location: Xiamen,Fujian Province, China

View user's profile Send private message Send e-mail ICQ Number

thx:)
PostPosted: Thu Feb 19, 2004 6:42 pm     Reply with quote

troky wrote:
It is based on Taylor series polynomial approximation... pure math.


Troky

where i can find something of Taylor series polynomial approximation?
thx:)
see u later
_________________
Lan Yong
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

PostPosted: Thu Feb 19, 2004 7:50 pm     Reply with quote

http://www.sosmath.com/calculus/tayser/tayser01/tayser01.html

And Google will generate as many more as you care to see... Shocked

Also if you have a university near by, a trip to their math & science library will bury you in Taylor Series information.
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
lanyong



Joined: 14 Jan 2004
Posts: 9
Location: Xiamen,Fujian Province, China

View user's profile Send private message Send e-mail ICQ Number

thank u very much!
PostPosted: Thu Feb 19, 2004 9:17 pm     Reply with quote

rwyoung wrote:
http://www.sosmath.com/calculus/tayser/tayser01/tayser01.html

And Google will generate as many more as you care to see... Shocked

Also if you have a university near by, a trip to their math & science library will bury you in Taylor Series information.


u r so kind for me! thanks:)
i have learn the math in university, but i have forgot it:)
so sorry:)
thanks very much!
_________________
Lan Yong
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

PostPosted: Fri Feb 20, 2004 8:51 am     Reply with quote

A classic case of "use it or loose it"!

When I think back on all the Calculus, Differential Equations, Matrix & Linear Algebra, and Statistics classes I had to take and then reflect on what I use daily it makes me sad. I could have spent those years drinking and chasing women in the college bars like the business majors! Crying or Very sad Wink
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
lanyong



Joined: 14 Jan 2004
Posts: 9
Location: Xiamen,Fujian Province, China

View user's profile Send private message Send e-mail ICQ Number

i can understand u a little
PostPosted: Mon Feb 23, 2004 12:41 am     Reply with quote

rwyoung wrote:
A classic case of "use it or loose it"!

When I think back on all the Calculus, Differential Equations, Matrix & Linear Algebra, and Statistics classes I had to take and then reflect on what I use daily it makes me sad. I could have spent those years drinking and chasing women in the college bars like the business majors! Crying or Very sad Wink


math is a tool, u can know it.
u should not know 1+1=?,u can know it by ur computer.
if there is no computer,u can use ur fingers to know it,before u know what "1+1=" means .
but before u use it(the math) ,u should know it is right or not.
_________________
Lan Yong
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group