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.

TAN SIN COS trigonometry in assembly, PIC18F4520

Status
Not open for further replies.

doucheful80

Junior Member level 1
Joined
Dec 14, 2011
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,414
Hi,

Is there an assembly code for arctan..or tan-1 that can be used in PIC18F4520 or others.
Im doing a robot that follow an x,y coordinate..so i need to calculate the angle from the input x,y to turn the robot's wheels

Thanks a lot!
 

Hello!

Don't compute! Use a lookup table. It's faster and accurate enough for that kind of application.

Dora.
 
I would agree with Dora.


A lookup table is usually preferable to calculating an inverse trigonometric or transcendental function on the fly.

The following a discussion of lookup tables in PIC Assembly:



Lookup Table faster?



However, if you absolutely must calculate arcTAN on the fly, the a CORDIC Algorithm would probably be my recommendation.

Arctan(x) using CORDIC


You might also find the following algorithm of interest:

XY vector to integer degree fast algorithm

BigDog
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top