File:Regression circulaire dist alg gander.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 468 × 364 pixels, file size: 21 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
English: Circle fitting by minimizing the algebraic distance. Created with Scilab, modified with Inkscape.
Français : Régression circulaire en minimisant la distance algébrique. Créé avec Scilab, modifié avec Inkscape.
Date
Source Own work, from Gander, W., Golub, G. H. and Strebel, R., Fitting of Circles and Ellipses. Least Squares Solution, Eidgenössische Technische Hochschule (ETH, Zürich), june 1994, report 217, [1]
Author Cdang

Scilab source

// **********
// Initialisation
// **********

clear;

// données (Gander et coll.)

X0 = [1, 2, 5, 7, 9, 3];
Y0 = [7, 6, 8, 7, 5, 7];

function [A] = regression_circulaire(X, Y)
    B = [X.^2 + Y.^2, X, Y, ones(X)];
    [U, S, V]= svd(B);
    u = V(:,4); a = u(1); b =[u(2); u(3)]; c = u(4);
    z = -b/2/a; r = sqrt(norm(z)^2 - c/a);
    A = [z', r];
endfunction

// **********
// programme principal
// **********

// lecture des données

// Xdef, Ydef : vecteurs ligne

Xdef = X0';
Ydef = Y0';

fenetre = scf(0); // création de la fenêtre graphique

// regression
[Aopt] = regression_circulaire(Xdef, Ydef)
centre = Aopt(1:2);
rayon = Aopt(3);
diam = 2*rayon;

print(%io(2), centre)
print(%io(2), rayon)

plot(Xdef, Ydef, 'b+');
plot(centre(1), centre(2), 'r+');
xarc(centre(1)-rayon, centre(2)+rayon, diam, diam, 0, 360*64)
xmin = min(centre(1)-rayon, min(Xdef));
xmax = max(centre(1)+rayon, max(Xdef));
ymin = min(centre(2)-rayon, min(Ydef));
ymax = max(centre(2)+rayon, max(Ydef));
isoview(xmin, xmax, ymin, ymax);

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following licenses:
GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported, 2.5 Generic, 2.0 Generic and 1.0 Generic license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
You may select the license of your choice.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current17:19, 3 January 2013Thumbnail for version as of 17:19, 3 January 2013468 × 364 (21 KB)Cdang (talk | contribs){{Information |Description ={{en|1=Circle -> red}} |Source ={{own}} |Author =Cdang |Date = |Permission = |other_versions = }}
16:54, 3 January 2013Thumbnail for version as of 16:54, 3 January 2013468 × 364 (21 KB)Cdang (talk | contribs){{Information |Description ={{en|1=Circle fitting by minimizing the algebraic distance. Created with Scilab, modified with Inkscape.}} {{fr|1=Régression circulaire en minimisant la distance algébrique. Créé avec Scilab, modifié avec Inkscape.}}...

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata