File:Regression circulaire coope points gruntz.svg

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

Original file(SVG file, nominally 349 × 346 pixels, file size: 21 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
English: Circle fitting, using Kåsa and Coope linear method (method of the algebraic distance), with the data set proposed by D. Gruntz. Created with Scilab, modified by Inkscape.
Français : Régression circulaire par la méthode linéaire de Kåsa et Coope (méthode de la distance algébrique), en utilisant le jeu de données proposé par Gruntz. Créé avec Scilab, modifié avec Inkscape.
Date
Source Own work
Coope, Ian D., Circle fitting by Linear and Nonlinear Least Squares, in "Journal of Optimization Theory and Applications", vol. 76, No. 2, pp. 381-388, february 1993
Gruntz, D., Finding the Best Fit Circle, in "The MathWorks Newsletter", Vol. 1, p. 5, 1990
Author Cdang (Christophe Dang Ngoc Chan)

Parameters of the circle:

  • xc = 3.06;
  • yc = 0.744;
  • r = 4.11.

Scilab source

// Initialisation

clear;

// données (D. Gruntz)

X0 = [0.7, 3.3, 5.6, 7.5, 6.4, 4.4, 0.3, -1.1];
Y0 = [4.0, 4.7, 4.0, 1.3, -1.1, -3.0, -2.5, 1.3];

// fonctions

// régression circulaire linéaire

function [C, r, R]=regression_circulaire(X, Y)
    // X, Y : points expérimentaux (vecteurs ligne)
    // C : coordonnées du centre du cercle (vecteur)
    // r : rayon du cercle (scalaire)
    A = [X ; Y];
    d = X.^2 + Y.^2;
    // xetoile = 2*xcentre
    // yetoile = 2*ycentre
    // zetoile = r^2 - (xcentre^2 + ycentre^2)
    [xyetoile, zetoile, sigma] = reglin(A, d');
    // A'\d' si l'on ne s'intéresse pas à l'écart
    C = 0.5*xyetoile;
    r = sqrt(zetoile + C(1)^2 + C(2)^2);
    R = sigma;
endfunction

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

// lecture des données

// Xdef, Ydef : vecteurs ligne
Xdef = X0;
Ydef = Y0;

// regression
[centre, rayon, ecart] = regression_circulaire(Xdef, Ydef)

// tracé

clf;
// points
plot2d(Xdef, Ydef, style = -1) //, frameflag=4)
isoview(-2, 8, -4, 6);
xstring(-1.5, 5.5, 'C('+string(centre(1))+' ; '+string(centre(2))+') ; r = '+string(rayon))
// modèle
plot(centre(1), centre(2), 'r+')
diametre = 2*rayon;
xarc(centre(1) - rayon, centre(2) + rayon,...
    diametre, diametre,...
    0, 360*64)
a = get('hdl'); // ellipse
a.foreground = 5; // couleur


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

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

File history

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

Date/TimeThumbnailDimensionsUserComment
current14:07, 7 December 2012Thumbnail for version as of 14:07, 7 December 2012349 × 346 (21 KB)Cdang (talk | contribs){{Information |Description ={{en|1=Circle fitting, using Coope linear method, with the data set proposed by D. Gruntz. Created with Scilab, modified by Inkscape.}} {{fr|1=Régression circulaire par la méthode linéaire de Coope, en utilisant le jeu...

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata