Re: Binary degrees?
From: Michael Stemper (mstemper_at_siemens-emis.com)
Date: 08/31/04
- Next message: papu: "Re: Sum of exp(-n^2) , n=0..N , N a positive integer."
- Previous message: Dar K.: "Barrie Glen MacGregor - October 13th 1941"
- Next in thread: Randy Poe: "Re: Binary degrees?"
- Maybe reply: Randy Poe: "Re: Binary degrees?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 31 Aug 2004 12:58:17 -0500
In article <6Yydncm6LNXR36_cRVnyuw@casema.nl>, Ruud Lustig writes:
>Now my question; wouldn't it be easier to use in computers a sort of Binary
>Degree (BDeg) in which, let's say 2*pi = 255 or X'FF BDeg.
No. Radians are the natural units for trig functions. In order to calculate
a sine, you would need to *convert* your angle from BDeg first. Either the
user would need to convert it, or that would be the first thing that the
function did.
>Would this make sin, cos etc. calculations easier using tablesearches,
Well, if you want to have an array of sines and look them up, that would
be very fast. It would also be inflexible. The first time that somebody
wanted sin(30 degrees), you'd be doing a less-than-accurate interpolation.
>Taylor expansions or whatever?
The Taylor expressions for sine and cosine are in terms of angles expressed
in radians. (Well, technically, they're not really in terms of *angles* at
all; just in terms of numbers.) So, multiplication by 2*PI would be needed.
>At least it is easy to see that an angle of X'123 BDeg = X'23 BDeg. That is
>much more easy to calculate than working with rads or Degrees.
I would think that any computer implementation would first do some
normalization like:
while( angle > Circle ) angle -= Circle;
Whether Circle==360 or Circle==2*PI or Circle=x100 doesn't really change this.
>I am specially interested in this in 8-bit microcontroller applications.
Ah-hah! That explains your interest in bytes!
> I
>have the feeling that this would make things easier. But does it really?
No. See above.
Whether your specific application would operate within spec for any
given algorithm is a very different question; one that we can't answer
with the information that you've given.
-- Michael F. Stemper #include <Standard_Disclaimer> You can lead a horse to water, but you can't make him talk like Mr. Ed by rubbing peanut butter on his gums.
- Next message: papu: "Re: Sum of exp(-n^2) , n=0..N , N a positive integer."
- Previous message: Dar K.: "Barrie Glen MacGregor - October 13th 1941"
- Next in thread: Randy Poe: "Re: Binary degrees?"
- Maybe reply: Randy Poe: "Re: Binary degrees?"
- Messages sorted by: [ date ] [ thread ]