Re: AngularFormat again
- To: mathgroup at smc.vnet.net
- Subject: [mg21215] Re: AngularFormat again
- From: phbrf at t-online.de (Peter Breitfeld)
- Date: Fri, 17 Dec 1999 01:29:14 -0500 (EST)
- References: <831sfd$fit@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Alan W.Hopper <awhopper at hermes.net.au> schrieb: > Hi everybody, [*** snipp ***] > Lastly, I wonder if anyone has a comment to make on the program below > which shows the difficulty in getting a 'correct' angle from coordinates > in all the 4 quadrants of the real Cartesian plane. Should there > be a built-in option to always get a positive angle result in Mathematica? > > > In[27]:= > quads4[x_,y_]:= Module[{a1,a2,a3,quots}, > N[ > a1 = ArcTan[y/x]/ Degree; > a2 = ArcTan[x,y]/ Degree; > a3 = a2; > If[a3 < 0, a3 = a3 + 360]; > quots = Tan[a3 Degree]; > {a1,a2,a3,quots},12]] > [*** snipp ***] > > I know that a2 is valid by Mathematica's Tan and ArcTan definitions, > > (Help Browser - ArcTan[x, y] gives the arc tangent of y/x, > taking into account which quadrant the point a is in.) > > But I personally prefer the a3 result. The easiest (?) would be a3= Mod[Tan[x,y],2Pi]/Degree Gruss Peter -- =--=--=--=--=--=--=--=--=--=--=--=--= http://home.t-online.de/home/phbrf =--= =--= Peter Breitfeld, Saulgau, Germany PGP public key: 08548045 =--=--=