Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Why 180 is used in this code ? (sinewave)

Status
Not open for further replies.

Maverickmax

Advanced Member level 1
Joined
Dec 6, 2004
Messages
404
Helped
8
Reputation
16
Reaction score
3
Trophy points
1,298
Activity points
3,689
Help - code

Hi

Can anyone tell me why 180 is used?


Code:
for (loopcount=0; loopcount<TABLE_SIZE; loopcount++){
		SineWave[loopcount]=(offset*sin(((loopcount*TempFloat)*3.14159)/180));

Maverick Max
 

Re: Help - code

Library functions are usually written for use with radians.

360° = 2pi

2pi / 360 = pi/180 = 3.141/180 in your code

Rod
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top