vod vos
2019-Dec-03  12:09 UTC
[R] How to find the best fit of inner cut ellipse to points in polar plot?
hi, 1. How to find the best fit of inner cut ellipse to points in polar plot? 2. How can we find the ellipse passing through most of the points in polar plot? And can we get the center x, center y, major radius, minor radius, and rotation angle of the ellipse? The csv data is attached. Thanks.
vod vos
2019-Dec-03  12:35 UTC
[R] 回复:How to find the best fit of inner cut ellipse to points in polar plot?
---- ? ???, 03 ??? 2019 04:09:12 -0800 vod vos <vodvos at zoho.com> ?? ---- > hi, > > 1. How to find the best fit of inner cut ellipse to points in polar plot? > > 2. How can we find the ellipse passing through most of the points in polar plot? > > And can we get the center x, center y, major radius, minor radius, and rotation angle of the ellipse? > > The csv data is attached. > > Thanks. We need just consider the r and theta columns in polar coordinate.
Abby Spurdle
2019-Dec-03  20:16 UTC
[R] How to find the best fit of inner cut ellipse to points in polar plot?
(1) There is no csv attached (may have been removed). (2) If you have a "polar plot", then wouldn't the "center" be the origin of the plot/coordinates? (3) If you don't need an exact ellipse, you could transform your coordinates into cartesian coordinates, and then use a periodic form of regression. (4) If you need an exact ellipse, then you would have (three?) parameters, ignoring the center. If you work out the R formula, then you could try nonlinear regression, to estimate those parameters, maybe... On Wed, Dec 4, 2019 at 1:09 AM vod vos via R-help <r-help at r-project.org> wrote:> > hi, > > 1. How to find the best fit of inner cut ellipse to points in polar plot? > > 2. How can we find the ellipse passing through most of the points in polar plot? > > And can we get the center x, center y, major radius, minor radius, and rotation angle of the ellipse? > > The csv data is attached. > > Thanks. > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Jim Lemon
2019-Dec-04  02:16 UTC
[R] 回复:How to find the best fit of inner cut ellipse to points in polar plot?
Hi vod,
Now that I have your data I can do a bit better:
# save data as "vv.csv"
vv<-read.csv("vv.csv")
# order the points in order of theta
vv<-vv[order(vv$theta),]
oldpar<-polar.plot(vv$r,vv$theta,main="Polar plat of
vv.csv",lwd=3,line.col=4,
 point.symbols=4,rp.type="p",show.centroid=TRUE,radial.lim=c(0,max(vv$r)))
draw.circle(0.3,0.15,radius=2.5,lwd=2,border="red")
draw.ellipse(0.28,0.15,a=2.6,b=2.5,angle=19,border="green")
Using a circle (red) there is not much left to explain. Adjusting the
major and minor axes and the angle gives a pretty good fit.
Jim
On Wed, Dec 4, 2019 at 10:44 AM vod vos <vodvos at zoho.com>
wrote:>
> Hi drjimlemon,
> Thank you, but it seems no working.
> The raw  csv file is here,  we need just consider the r and theta columns
in polar coordinate.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vv.png
Type: image/png
Size: 67427 bytes
Desc: not available
URL:
<https://stat.ethz.ch/pipermail/r-help/attachments/20191204/928347e8/attachment.png>