File:Regression circulaire coope arc de cercle.svg

From formulasearchengine
Jump to navigation Jump to search

Original file(SVG file, nominally 442 × 363 pixels, file size: 20 KB)

This file is from Wikimedia Commons and may be used by other projects. The description on its file description page there is shown below.

 
W3C-validity not checked.

Summary

Description
English: Circle fitting, the points describing only an arc. Kåsa and Coope linear algorithm (method of the algebraic distance). The real values are:
  • C(1 ; 1);
  • r = 4.
Created with Scilab, modified with Inkscape.
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 :
  • C(1 ; 1) ;
  • r = 4.
Créé avec Scilab, modifié avec Inkscape.
Date
Source Own work
Author Cdang (Christophe Dang Ngoc Chan)

Scilab source

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:
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.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

7 December 2012

File history

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

Date/TimeThumbnailDimensionsUserComment
current17:51, 7 December 2012Thumbnail for version as of 17:51, 7 December 2012442 × 363 (20 KB)wikimediacommons>Cdang{{Information |Description ={{en|1=Circle fitting, the points describing only a bow. Coope linear algorithm. The real values are: * C(1 ; 1); * ''r'' = 4. Created with Scilab, modified with Inkscape.}} {{fr|1=Régression circulaire sur des points d ...

There are no pages that use this file.