www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/01/13:15:18

From: Martin Ambuhl <mambuhl AT earthlink DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Trig
Date: Sat, 01 May 1999 12:39:42 -0400
References: <7gf98i$bc8 AT journal DOT concentric DOT net>
X-Posted-Path-Was: not-for-mail
X-Accept-Language: en
X-ELN-Date: 1 May 1999 16:38:39 GMT
X-ELN-Insert-Date: Sat May 1 09:45:12 1999
Organization: Nocturnal Aviation
Lines: 21
Mime-Version: 1.0
NNTP-Posting-Host: 1cust61.tnt14.nyc3.da.uu.net
Message-ID: <372B2E4E.C416477B@earthlink.net>
X-Mailer: Mozilla 4.51 [en] (Win95; I)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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.  

-- 
Martin Ambuhl (mambuhl AT earthlink DOT net)
Note: mambuhl AT tiac DOT net will soon be inactive

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019