the angle of a straight line drawn between 2 points
Subject: the angle of a straight line drawn between 2 points
From: Richard Fateman
Date: Sun, 27 May 2012 12:25:33 -0700
On 5/27/2012 11:51 AM, Adam Majewski wrote:
...
I don't know if the algorithm is right, but the program can be made more
succinct, and
fixed so that b is local...
something like
gt(r,s):=
block([b:
float(atan2(imagpart(s)-imagpart(r),realpart(s)-realpart(r))/2*%pi)],
b + (if (b<0) then 1 else 0))
or even..
gt(r,s):= (r:float(r-s), r: 0.5*atan2(imagpart(r),realpart(r))/?pi,
r+(if (r<0) then 1 else 0))