Generate points distributed with some errors around a circle Fit a circle through the points and draw To run the script, do, eg
root > .x fitCircle.C (10000
points by
default)
root > .x fitCircle.C(100); (with only 100
pointsroot > .x fitCircle.C(100000); with ACLIC
Processing /mnt/build/workspace/root-makedoc-v610/rootspi/rdoc/src/v6-10-00-patches/tutorials/fit/fitCircle.C...
****************************************
Minimizer is Minuit / Migrad
MinFCN = 903.174
NDf = 0
Edm = 2.25067e-09
NCalls = 72
x0 = 0.00667777 +/- 0.0141774
y0 = 0.00536467 +/- 0.0141954
R = 3.995 +/- 0.0100048
void fitCircle(
Int_t n=10000) {
}
for (
Int_t i=0;i<np;i++) {
f += dr*dr;
}
};
double pStart[3] = {0,0,1};
if (!ok) {
Error(
"line3Dfit",
"Line3D Fit failed");
}
}
- Author
- Rene Brun
Definition in file fitCircle.C.