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

math.h

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



Joined: 10 Dec 2011
Posts: 376
Location: Sofiq,Bulgariq

View user's profile Send private message

math.h
PostPosted: Mon Feb 27, 2012 11:49 am     Reply with quote

Hello! How could I return sinus value from a given angle. I'm using 18f2520 and I wanna utilize with trigonometric functions. Some sample codes would be very useful. Excuse my bad english.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Feb 27, 2012 1:56 pm     Reply with quote

Read the description of the sin() function in math.h. It's right there:
Code:

////////////////////////////////////////////////////////////////////////////
//   float sin(float x)
////////////////////////////////////////////////////////////////////////////
// Description : returns the sine value of the angle x, which is in radians

You give the sin() function an angle (in Radians, not degrees) and you get
back the sine value (as a floating point number).
rikotech8



Joined: 10 Dec 2011
Posts: 376
Location: Sofiq,Bulgariq

View user's profile Send private message

PostPosted: Mon Feb 27, 2012 2:24 pm     Reply with quote

oh I see! My mistake was that I put angle with degree dimension. I test the formula: result = sin((3.14*angle_degree)/180) and it works. Thank you very much.
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