Regression_circulaire_coope_arc_de_cercle.svg
Size of this PNG preview of this SVG file:
442 × 363 pixels
.
Other resolutions:
292 × 240 pixels
|
585 × 480 pixels
|
935 × 768 pixels
|
1,247 × 1,024 pixels
|
2,494 × 2,048 pixels
.
Summary
Description Regression circulaire coope arc de cercle.svg |
English:
Circle fitting, the points describing only an arc. Kåsa and Coope linear algorithm (method of the algebraic distance). The real values are:
Français :
Régression circulaire sur des points ne décrivant qu'un arc. Algorithme linéaire de Kåsa et Coope (méthode de la distance algébrique). Les valeurs réelles sont :
|
Date | |
Source | Own work |
Author | Cdang (Christophe Dang Ngoc Chan) |
Scilab source
This media was created with
Scilab
, a free open-source software.
Here is a listing of the Scilab source used to create this file. |
Crée les données et les enregistre dans le fichier
arc_cercle_bruite.txt
.
// **********
// Initialisation
// **********
clear;
chdir('monchemin/');
// **********
// Constantes
// **********
// paramètres de l'arc de cercle
centre=[1;1];
rayon = 4;
angle = %pi/3:0.1:2*%pi/3;
// paramètres du bruit
var = 0.05;
// **********
// Programme principal
// **********
// génération des données
ligne_rayon_bruite = rayon + var*rand(angle,'norm');
foo = [cos(angle);sin(angle)].* ...
[ligne_rayon_bruite;ligne_rayon_bruite];
arc_cercle_bruite(1,:) = centre(1) + foo(1,:);
arc_cercle_bruite(2,:) = centre(2) + foo(2,:);
clf
plot(arc_cercle_bruite(1,:), arc_cercle_bruite(2,:), '+')
write('arc_cercle_bruite.txt', arc_cercle_bruite')
Lit les données de
arc_cercle_bruite.txt
et effectue la régression circulaire.
// **********
// Initialisation
// **********
clear;
chdir('monchemin/')
// **********
// 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);
C = 0.5*xyetoile;
r = sqrt(zetoile + C(1)^2 + C(2)^2);
// A'\d' si l'on ne s'intéresse pas à l'écart
R = sigma;
endfunction
// **********
// programme principal
// **********
// lecture des données
// Xdef, Ydef : vecteurs ligne
donnees = read('arc_cercle_bruite.txt', -1, 2)';
Xdef = donnees(1,:);
Ydef = donnees(2,:);
// regression
[centre, rayon, ecart] = regression_circulaire(Xdef, Ydef)
// tracé
clf;
// points
plot2d(Xdef, Ydef, style = -1) //, frameflag=4)
isoview(-2, 4, 1, 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
I, the copyright holder of this work, hereby publish it under the following license:
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.
http://creativecommons.org/publicdomain/zero/1.0/deed.en CC0 Creative Commons Zero, Public Domain Dedication false false |