Re: show residuals of circle fit
- To: mathgroup at smc.vnet.net
- Subject: [mg79949] Re: show residuals of circle fit
- From: Ray Koopman <koopman at sfu.ca>
- Date: Thu, 9 Aug 2007 05:25:12 -0400 (EDT)
- References: <f9c0vf$6cg$1@smc.vnet.net>
This plots the radial residuals as a function of the angle. SeedRandom[1]; points = Table[theta = Random[]; {2*Cos[theta] + 1 + .05*Random[], 2*Sin[theta] - 3 + .05*Random[]}, {30}]; {rad, cen} = hypersphereFit[points] {2.05827,{0.96721,-2.98603}} ListPlot[points, PlotRange->All, AspectRatio->Automatic, Axes->None, Prolog->{Circle[cen,rad,{0,1}], PointSize[.02]}]; ListPlot[{ArcTan@@(#-cen),Norm[#-cen]-rad}& /@ points, PlotRange->All, Prolog->PointSize[.015]];