MaxBend in ParametricPlot?
- To: mathgroup at smc.vnet.net
- Subject: [mg12924] MaxBend in ParametricPlot?
- From: weber at math.uni-bonn.de (Matthias Weber)
- Date: Wed, 24 Jun 1998 03:44:43 -0400
- Organization: RHRZ - University of Bonn (Germany)
- Sender: owner-wri-mathgroup at wolfram.com
Hello, I am having trouble with the results I get by ParametricPlot. The documentation is sufficiently incomplete to prevent me from calling this a bug, but at least I would like to report the _behaviour_ I am unhappily confronted with: When I draw a round circle with ParametricPlot, I would expect to get the sample points more or less equidistributed, but the resulting distribution is rather strange. At the end is some code illustrating what I will explain now. The online doc says that Plot and ParametricPlot use an adaptive algorithm so that the kink angle between successive segments does not exceed MaxBend, which is '10' by default. (10 degrees, I suppose?). The minimal number of sample points is given by PlotPoints, which initially is 25. If I set MaxBend->1000 (degrees??), I get a list of 39 points. When setting PlotDivision->1 (which, as I understand it, should prevent any further subdivision), I get 40 points. All this lacks an explanation to me. The kink angle between consectutive segments on the drawn unit circle with initial settings varies (roughly) between 0.4 and 8.0 degrees, points with small kink angle accumulate near the points {0,0},{0,1},{-1,0},{0,-1}. For the application I have in mind I want to extract the data computed by ParametricPlot and to use them, but I was hoping that ParametricPlot gives 'more adaptive' results. Is there a parameter setting which gives (near) equidistribution for a circle and is nevertheless adaptive in general? Is there a desription of the algorithm behind ParametricPlot available? Has somebody written his/her own version already? Matthias Weber (* extract point list from Graphics object: *) toList[Graphics[{{Line[gr_]}}, opt___]]:=List@@gr (* default values for options *) l1=toList[ParametricPlot[{Cos[s], Sin[s]},{s,0,2Pi},AspectRatio->Automatic, DisplayFunction->Identity]]; Length[l1] (* MaxBend->1000 *) l2=toList[ParametricPlot[{Cos[s], Sin[s]},{s,0,2Pi},MaxBend->1000, AspectRatio->Automatic, DisplayFunction->Identity]]; Length[l2] (* my kink angle computation -- radians *) angle[p_,q_]:=Arg[(q[[1]]+I q[[2]])/(p[[1]]+I p[[2]])] (* Plot consecutive kink angles as a ListPlot *) kinkplot[l_]:= ListPlot[Table[angle[l[[i+1]]-l[[i]],l[[i]]-l[[i-1]]],{i,2,Length[l]-1}]] kinkplot[l1] kinkplot[l2]