From: Dmitry A. Kazakov on
On Thu, 12 Aug 2010 00:54:52 -0700, Charles H. Sampson wrote:

> Simon Wright <simon(a)pushface.org> wrote:
>
>> csampson(a)inetworld.net (Charles H. Sampson) writes:
>>
>>> I then overloaded "+" and "-" for (Bearing, Turn_Angle) arguments
>>> and Bearing return value. In those functions is where the mod 360
>>> occurred. (Actually, mod 360.0, as it were.)
>>
>> Depending on what is doing the turning, in our application that would
>> in some cases have to be mod 720.0 ...
>
> I'm puzzled. Unless you're very careful, intermediate calculations
> could result in a quasi-Bearing of more than 360 degrees but I'm pretty
> sure most programmers on my project would have been surprised to see a
> real bearing of 360 degrees or more.

Maybe it was rhumbs? Just could not resist, sorry (:-))

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
From: Brian Drummond on
On Thu, 12 Aug 2010 00:54:52 -0700, csampson(a)inetworld.net (Charles H. Sampson)
wrote:

>Simon Wright <simon(a)pushface.org> wrote:
>
>> csampson(a)inetworld.net (Charles H. Sampson) writes:
>>
>> > I then overloaded "+" and "-" for (Bearing, Turn_Angle) arguments
>> > and Bearing return value. In those functions is where the mod 360
>> > occurred. (Actually, mod 360.0, as it were.)
>>
>> Depending on what is doing the turning, in our application that would
>> in some cases have to be mod 720.0 ...
>
> I'm puzzled. Unless you're very careful, intermediate calculations
>could result in a quasi-Bearing of more than 360 degrees but I'm pretty
>sure most programmers on my project would have been surprised to see a
>real bearing of 360 degrees or more.

Some applications must distinguish between odd and even revolutions.
Get it wrong and they might backfire.

- Brian

From: Charles H. Sampson on
Ludovic Brenta <ludovic(a)ludovic-brenta.org> wrote:

> Charles H. Sampson wrote on comp.lang.ada:
> [on defining "+" to add angles in modular arithmetic]
> >> Sounds to me like a good way to do things. It would still be a good
> >> idea if you called it "Turn_Left" or something like that, instead
> >> of "+". But I don't object to "+".
> >
> > This was for the U. S. Navy, and "positive is right" is pretty much
> > universal. For programmers, that is, not for sailors. They think port
> > and starbord.
>
> Actually, to mathematicians and engineers, "+" is "turn counter-
> clockwise" or "turn left", too. Granted, they'd probably use radians
> instead of degrees. So, "+" meaning "turn right" is not as universal
> as you might think.

You're right, of course. I was being a bit too elliptical. I
should have said Navy programmers (and Navy mathematicians, for that
matter). In the U. S. Navy, a bearing of 0 degrees is due North, 90
degrees is East, etc.

Charlie
--
All the world's a stage, and most
of us are desperately unrehearsed. Sean O'Casey
From: Jeffrey Carter on
On 08/12/2010 10:10 AM, Charles H. Sampson wrote:
>
> You're right, of course. I was being a bit too elliptical. I
> should have said Navy programmers (and Navy mathematicians, for that
> matter). In the U. S. Navy, a bearing of 0 degrees is due North, 90
> degrees is East, etc.

This is also the convention used in aviation.

--
Jeff Carter
"What I wouldn't give for a large sock with horse manure in it."
Annie Hall
42

--- news://freenews.netfront.net/ - complaints: news(a)netfront.net ---
From: Simon Wright on
csampson(a)inetworld.net (Charles H. Sampson) writes:

> Simon Wright <simon(a)pushface.org> wrote:
>
>> csampson(a)inetworld.net (Charles H. Sampson) writes:
>>
>> > I then overloaded "+" and "-" for (Bearing, Turn_Angle) arguments
>> > and Bearing return value. In those functions is where the mod 360
>> > occurred. (Actually, mod 360.0, as it were.)
>>
>> Depending on what is doing the turning, in our application that would
>> in some cases have to be mod 720.0 ...
>
> I'm puzzled. Unless you're very careful, intermediate calculations
> could result in a quasi-Bearing of more than 360 degrees but I'm pretty
> sure most programmers on my project would have been surprised to see a
> real bearing of 360 degrees or more.

A tracker radar like this one (hope the link will work) might be able to
turn through an unlimited number of revolutions, or (with a more
mechanical design) there might be a limit on how many revs it could
manage. So if it's currently pointing 10 degrees to starboard, how much
further can it go before having to unwind?

I agree that this is Training, not Bearing, of course.

http://www.artisan3d.co.uk/static/bae_cimg_radar_Fi_latestReleased_bae_cimg_radar_Fi_Web.jpg