delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/23/17:30:06

Sender: nate AT cartsys DOT com
Message-ID: <36D32B6D.9C76AF25@cartsys.com>
Date: Tue, 23 Feb 1999 14:27:57 -0800
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.1 i586)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: math problem
References: <36d2d0aa DOT 0 AT news DOT sbbs DOT se>
Reply-To: djgpp AT delorie DOT com

Erik Johansson wrote:
> 
> if i have a line like this
> y
> |     /
> |    /
> |   /
> |  /
> | /
> |/_____________ x
> 
> How can I calculate the angle of that line in degrees?

atan2(y,x)*(180/M_PI)

Read up on trigonometry.
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


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