Path: csiph.com!1.us.feeder.erje.net!2.us.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!news.szaf.org!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail From: =?UTF-8?Q?Hans-Bernhard_Br=c3=b6ker?= Newsgroups: comp.graphics.apps.gnuplot Subject: Re: gnuplot (fitting of ellipse) Date: Sat, 25 Mar 2017 14:22:54 +0100 Lines: 38 Message-ID: References: <1d68425b-6a98-4762-8f7a-3091b9198947@googlegroups.com> <9ff689bb-3cb6-4b40-be9e-3411d86743dd@googlegroups.com> <7f0d850e-449b-4730-8bbd-955180c3772d@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.dfncis.de 3OkunahB4PQhFRd8lXQxTQWu52tB4Uts29hcCHEcmS1GZH5hLNe78NTwTc Cancel-Lock: sha1:lKaDyJqjfNhmJlkVxm4R/soCsHc= User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: <7f0d850e-449b-4730-8bbd-955180c3772d@googlegroups.com> Xref: csiph.com comp.graphics.apps.gnuplot:3595 Am 25.03.2017 um 01:55 schrieb vineeth25396@gmail.com: > The reason why I use the > formula cause I have a C++ code that gives the co-efficient of the > ellipse in form of a,b,c,d,e,f. And I want to see if the co-efficents > are matching. The link below will make more sense > https://en.wikipedia.org/wiki/Matrix_representation_of_conic_sections A large part of the problem with your description, and of the cause for the failures you've run across is sloppy use of terminology. The equation you started out with isn't that of an ellipse. It's not even really an equation. It's the definition of a quadratic function of two variables. What you're talking about is the implicit equation for an ellipse made by that function, by convention: f(x,y) = 0 gnuplot doesn't plot implicit equations just like that. You have to plot intersection of the surface made up by points < x,y,f(x,y) > with the implicit surface z=0. As this is about surfaces, you have to use splot for this, plot. Then see "help contour" about how to get just the intersection curve. Or you could apply the math of conic sections to transform your impliciat equation into the explicit form of the elleipse, i.e. two new functions, x(t) and y(t) that trace the ellipse. Written as 2D vectors, that explicit form will be of the general form X = X_0 + A * cos(t) + B * sin(t) | t = 0 ... 2*pi where vectors A and B are orthogonal to each other. gnuplot can plot that in parametric mode.