Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Sorting complex points

  • To: mathgroup at smc.vnet.net
  • Subject: [mg55911] Re: Sorting complex points
  • From: "Alan" <info at optioncity.REMOVETHIS.net>
  • Date: Sat, 9 Apr 2005 03:56:47 -0400 (EDT)
  • References: <d356km$ovn$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

"OT" <montoz at iol.it> wrote in message news:d356km$ovn$1 at smc.vnet.net...
> Hi all,
>
> I'm trying to sort lists of random complex points on the unit circle
> using their angles as criterion to sort them: I mean, if
> z=Cos[a]+I*Sin[a] and w=Cos[b]+I*Sin[b]( 0<=a,b<2*Pi ),
> I want z<w if a<b;
>
> how can i do that?

Take a list of points on the unit circle:
pts = Table[E^(I Random[] ), {i, 1, 5}]

Then

Sort[pts, Arg[#1] < Arg[#2] &]

alan





  • Prev by Date: Internet links/URLs/browser activation from with an Mathematica notebook?
  • Next by Date: Problems with Derivative, Piecewise, Assuming
  • Previous by thread: Re: Sorting complex points
  • Next by thread: Re: Sorting complex points