Path: csiph.com!1.us.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!feeder5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Karl Ratzsch Newsgroups: comp.graphics.apps.gnuplot Subject: Re: gnuplot (fitting of ellipse) Date: Fri, 24 Mar 2017 11:28:12 +0100 Organization: solani.org Lines: 46 Message-ID: References: <1d68425b-6a98-4762-8f7a-3091b9198947@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: solani.org 1490351299 26989 eJwFwQcBACAIBMBKAj4jDjL6R/AOoqRlV6EXi7UsesJUPi1HdkERRTnuj6vzGAbLzRtBhfgmWxFl (24 Mar 2017 10:28:19 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Fri, 24 Mar 2017 10:28:19 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cancel-Lock: sha1:2s+heuz1loR1HOVO98IG+WgNcTk= X-NNTP-Posting-Host: eJwFwYERACEIA7CVvtQWHQf02H+ET0TDN5flpdG4tr6jxBVdhw0RKPYgX4duHHdVEHp7GD8DLBBf X-User-ID: eJwFwQkBwDAIA0BLNDQ8cqAM/xJ2R7Vjz6/RLpcLNEsBGaUPoZogcqa/U68DxRGJrSjfFPkBChMQuQ== In-Reply-To: <1d68425b-6a98-4762-8f7a-3091b9198947@googlegroups.com> Xref: csiph.com comp.graphics.apps.gnuplot:3591 Am 24.03.2017 um 10:24 schrieb vineeth25396@gmail.com: > I'm trying to fit an ellipse using gnuplot. > > However, when I defined my equation > > f(x,y) = a*x*x + b*x*y + c*y*y + d*x + e*y + f > and then proceed with the command plot: > > plot f(x,y) lw 3 lc rgb 'black', 'text.dat' w l lc rgb 'black' > > I get undefined variable: y. How can I fix it? text.dat has 3 columns: x, y, and z coordinates. > > Or with is the best solution to fit ellipse using the above equation. > > Also, is there a way to find the values of the co-efficients i.e a,b,c,d,e,f I take it your function should be named z(x,y) = a*x*x + b*x*y + c*y*y + d*x + e*y + f right? But that's not an ellipse, it's a plane. An ellipse needs just one independent variable, the angle or the circumference, and two functions. set param plot a*cos(t),b*sin(t) gives you an example. Btw. "plot" can only use a function with one independent variable, in 2D. You need to use "splot". And "fitting" does just that, find out the parameters a...f: fit z(x,y) dataf us 1:2:3 via a,b,c,d,e,f should do just that. You don't get an ellipse, but a plane in which the ellipse lies. If you supply good starting parameters, that is. Not sure if trying by hand will work. You should transform your equation into sth with more meaningful variables.