Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

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,691
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
 

rod_vdb

Newbie level 4
Joined
Jan 16, 2006
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,348
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.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top