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 CCS Technical Support

Math libary problem

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







Math libary problem
PostPosted: Sun Apr 02, 2006 7:32 am     Reply with quote

Hi,

my problem is, that the math libary use a "RAD" calculation for sin and cos. How i can get the result in "DEG"

Anyone who know´s

Thanks Thorsten
Charlie U



Joined: 09 Sep 2003
Posts: 183
Location: Somewhere under water in the Great Lakes

View user's profile Send private message

PostPosted: Sun Apr 02, 2006 9:17 am     Reply with quote

The sin and cosine functions use angles as arguments and they return a value between +1.0 and -1.0. Most calculators either take degrees as the argument or can be changed from degrees to radians. The conversion is 360 degrees equals 2*pi radians. So to convert degrees to radians divide your argument (in degrees) by 360 and multiply by 2*pi. pi = 3.14159265 and 2*pi = 6.28318531.

As an example we'll convert 45 degrees to radians:

45 degrees / 360 = 0.125. Then 0.125 * 6.28318531 = 0.78539816 radians.
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