the angle of a straight line drawn between 2 points
Subject: the angle of a straight line drawn between 2 points
From: Adam Majewski
Date: Mon, 28 May 2012 18:16:18 +0200
On 27.05.2012 21:25, Richard Fateman wrote:
> 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))
Thx for an answer.
I'm not an expert but in my little experience it is better in Maxima
when definition and initialisation of local variables are separated, like :
[b,a],
b:2,
a:1,
....
instead of :
[b:2, a:1]
Is it true or not ?
Adam