MathGroup Archive 2005

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

Search the Archive

Re: Sorting complex points





sortedData=Sort[data, Arg[#1]<Arg[#2]&];


Bob Hanlon

> From: OT <montoz at>
To: mathgroup at
> Date: 2005/04/08 Fri AM 01:37:06 EDT
> To: mathgroup at
> Subject: [mg55888] [mg55874] Sorting complex points
> 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?
> I tried to define Angle[z] as a piecewise funztion, but I still don't 
> understand how to use it with Sort...
> Thanks,
> andrea

  • Prev by Date: Re: Newly Released Mathematica 5.1 Delivers Unmatched Performance for Handling Data
  • Next by Date: Re: Sorting complex points
  • Previous by thread: Re: Sorting complex points
  • Next by thread: Re: Sorting complex points