Re: Re: Searching list for closest match to p
- To: mathgroup at smc.vnet.net
- Subject: [mg79398] Re: [mg79341] Re: Searching list for closest match to p
- From: Murray Eisenberg <murray at math.umass.edu>
- Date: Thu, 26 Jul 2007 05:23:59 -0400 (EDT)
- Organization: Mathematics & Statistics, Univ. of Mass./Amherst
- References: <200707250605.CAA20418@smc.vnet.net>
- Reply-to: murray at math.umass.edu
But there's a syntax error in that code.
chuck009 wrote:
> Thanks Peter. That's nice code you wrote. I do lots of work with complex variables. The construct:
>
> Through[{Re,Im}[#]] & @@@
>
> I'll find useful. I see your code relies on Pick. Didn't know about that one. That's helpful to know. Also the Epilog construct in ListPlot is nice: doesn't require the Graphics prefix I see.
>> Maybe this version using Pick[] is more pleasant?
>>
>> p3color = Red;
>> circleColor = Blue;
>> p3 = Exp[I*Pi/3];
>> s100 = SeriesCoefficient[Series[Log[1 + x], {x, 0,
>> 100}], #]x^# & /@
>> Range[100];
>>
>> p3vals = Through[{Re, Im}[#]] & @@@ Table[
>> zlist = x /. NSolve[Total[Take[s100, nval]]
>> 00, nval]] == 0];
>> Pick[zlist, #, Min[#]] &[Abs[zlist - p3]],
>> {nval, 100}];
>>
>> lp3 = ListPlot[p3vals, PlotRange -> All, AspectRatio
>> -> Automatic,
>> Epilog -> {circleColor, Circle[{0, 0}, 1, {0,
>> {0, Pi/2}], p3color,
>> PointSize[.03], Point[Through[{Re, Im}[p3]]]}]
>>
>> Peter
>>
>
--
Murray Eisenberg murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305
- References:
- Re: Searching list for closest match to p
- From: chuck009 <dmilioto@comcast.com>
- Re: Searching list for closest match to p