Mail Archives: djgpp/1999/05/03/09:36:55
In article <372B2E4E DOT C416477B AT earthlink DOT net>, mambuhl AT earthlink DOT net says...
>
>Paradox wrote:
>>
>> How do I use Trig to determine the reverse slope of an object traveling at n
>> degrees? And vise versia?
>>
>> Paradox
>
>Since you are using gcc, <math.h> will provide M_PI, as long as you are not
>compiling in ANSI mode. This allows you to convert an angle from degrees into
>radian measure:
>
>#define radians(a) )(a)*(M_PI/180.))
>
>The slope (dy/dx) is just tan(radians(angle)).
>
>This is extremely simple math and should be learned before attempting such
>programming.
Agreed. The simple way is
if( angle < 180 )
angle += 180;
else
angle = 360 - angle;
I used to use this about 30 years ago when the army dropped me off in the
middle of nowhere with a map, compas, protractor and pencil. If you wanted
supper you marched to map reff where you would be picked up. We had to find
where we were on the map by taking compas bearings on mountains and the like
and drawing two back bearings on the map. X marks the spot you are at.
- Raw text -