A TH2Poly build with Fibonacci numbers.
In mathematics, the Fibonacci sequence is a suite of integer in which every number is the sum of the two preceding one.
The first 10 Fibonacci numbers are:
1, 1, 2, 3, 5, 8, 13, 21, 34, 55, ...
This tutorial computes Fibonacci numbers and uses them to build a TH2Poly producing the "Fibonacci spiral" created by drawing circular arcs connecting the opposite corners of squares in the Fibonacci tiling.
void Arc(
int n,
double a,
double r,
double *px,
double *py);
C->SetFrameLineWidth(0);
h2pf->SetTitle(
Form(
"The first %d Fibonacci numbers",
N));
for (
int i=0; i<=
N; i++) {
}
h2pf->Draw(
"A COL L TEXT");
}
void Arc(
int n,
double a,
double r,
double *px,
double *py) {
for (
int i = 2; i<=
n-2; i++) {
}
}
static double T = 1.;
static double B = 0.;
case 1:
Arc(
NP,3*pi2,(
double)
N,px,py);
break;
case 2:
break;
case 3:
break;
case 4:
Arc(
NP,2*pi2,(
double)
N,px,py);
break;
}
else h2pf->AddBin(
NP, px ,py);
}
#define R(a, b, c, d, e, f, g, h, i)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
2D Histogram with Polygonal Bins
RooArgList L(Args_t &&... args)
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
- Author
- Olivier Couet
Definition in file Fibonacci.C.