From: John Woodgate
Subject: Re: Arctangent computation.
Date: Sat, 16 Nov 2002 14:47:17 +0000
Organization: JMWA Electronics Consultancy
Reply-To: John Woodgate
NNTP-Posting-Date: Sat, 16 Nov 2002 18:01:59 +0000 (UTC)
X-Newsreader: Turnpike (32) Version 4.01 <5Z8C9wtxbnpWyFnyfFzqmVF739>
I read in sci.electronics.design that Dan
wrote (in <email@example.com>) about 'Arctangent
computation.', on Sat, 16 Nov 2002:
>Thank you all for the feedback, I am leaning towards an ADC/8051
>solution, may be a polynomial approx./look-up table.
>Does anybody have any code that I could use?
>Also, Mr. Burke, what do you mean by "see John Woodgate"?
Maybe you didn't see my earlier post:
There are a number of ways to do this. It would be a good thing to avoid
the division if you look for an analogue solution, and that is possible.
Logarithmic division isn't practicable AFAIK because the sin and cos
functions can take zero as a value.
Start with the sin output and 'full-wave rectify' it to get |sin theta|.
You can make a non-linear converter with an op-amp and diodes that will
do the arcsin conversion for one quadrant (in which arcsin is single-
valued) but you don't know which quadrant theta is in. You can find that
by determining the polarities of the sin and cos outputs and using a
simple table, and then use simple logic gates or comparators, and
analogue switches, to offset the arcsin output into the right quadrant:
(Use Courier font)
sin cos quadrant
+ + 1
+ - 2
- - 3
- + 4
Regards, John Woodgate, OOO - Own Opinions Only. http://www.jmwa.demon.co.uk
Interested in professional sound reinforcement and distribution? Then go to
PLEASE do NOT copy news posts to me by E-MAIL!