Re: Problem with finding angles between points in Cartesian plane
- To: mathgroup at smc.vnet.net
- Subject: [mg26119] Re: Problem with finding angles between points in Cartesian plane
- From: "Paul Lutus" <nospam at nosite.com>
- Date: Tue, 28 Nov 2000 01:56:05 -0500 (EST)
- References: <8vfqv9$jif@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
"Blitzer" <drek1976 at yahoo.com> wrote in message news:8vfqv9$jif at smc.vnet.net... > I would like to find the angle between 2 points on the Cartesian plane. > However, if I use "ArcTan", it is not able to recognise that points with the > same x-coordinates have an angle of 90 degrees between them. It returns > "Indeterminate". > eg. for a point A (x1, y1) and a point (x1, y2), to find the angle between > them, I use ArcTan[(y2-y1)/(x1-x1)]. However, as the denominator is equal to > "0", this function returns "indeterminate". Is there a way to get around > this problem? Or is there other possible functions which can be used. > I am dealing with a very large array of numbers and thus, it's not possible > to check the coordinates individually. In[49]:= For[a = 0,a <=360, x = Cos[a Degree]; y = Sin[a Degree]; q = ArcTan[x,y] / Degree; q = If[q < 0,360+q,q]; Print[a," ",N[q]]; a += 45] -- prints the input and output angles in the range 0 - 360 degrees. -- Paul Lutus www.arachnoid.com