www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/03/15:05:56

From: Martin Ambuhl <mambuhl AT earthlink DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: angle
Date: Wed, 03 Mar 1999 13:53:32 -0500
References: <36dd5abb DOT 0 AT news DOT sbbs DOT se> <36DD5FEC DOT 840A4B7 AT unb DOT ca>
X-Posted-Path-Was: not-for-mail
X-Accept-Language: en
X-ELN-Date: 3 Mar 1999 18:53:28 GMT
X-ELN-Insert-Date: Wed Mar 3 11:15:33 1999
Organization: Nocturnal Aviation
Lines: 18
Mime-Version: 1.0
NNTP-Posting-Host: 1cust181.tnt11.nyc3.da.uu.net
Message-ID: <36DD852C.BA45FD0B@earthlink.net>
X-Mailer: Mozilla 4.5 [en] (Win95; I)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Endlisnis wrote:
> 
> Erik Johansson wrote:
> 
> > Lets say I have two points on the screen. (x1,y1) and (x2,y2)
> > And then I draw a line between the points.
> > How can I calculate the angle of that line in degrees?
> >
> > thanx in advance
> > /erik
> 
> angle = atan(y2-y1, x2-x1) * (180/M_PI);
          ^^^^ 
should be atan2.  atan() takes a single argument.           

-- 
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