Logo ROOT  
Reference Guide
No Matches
gltf3.C File Reference

Detailed Description

Draws the Klein bottle.

Klein bottle is closed non-orientable surface that has no inside or outside. TF3 can be drawn in several styles:

  • default - like surface4
  • kMaple0 - very nice colours
  • kMaple1 - nice colours and outlines
  • kMaple2 - nice colour outlines. To switch between them, you can press 's' key.
void gltf3()
TCanvas *cnv = new TCanvas("gltf3", "TF3: Klein bottle", 200, 10, 600, 600);
TPaveLabel *title = new TPaveLabel(0.04, 0.86, 0.96, 0.98,
"\"gl\" option for TF3. Select plot and press 's' to change the color.");
TPad *tf3Pad = new TPad("box", "box", 0.04, 0.04, 0.96, 0.8);
TFormula f1 = TFormula("f1", "x*x + y*y + z*z + 2*y - 1");
TFormula f2 = TFormula("f2", "x*x + y*y + z*z - 2*y - 1");
// Klein bottle with cut top&bottom parts
// The Klein bottle is a closed non-orientable surface that has no
// inside or outside.
TF3 *tf3 = new TF3("Klein Bottle","f1*(f2*f2-8*z*z) + 16*x*z*f2",
-3.5, 3.5, -3.5, 3.5, -2.5, 2.5);
@ kRed
Definition Rtypes.h:66
R__EXTERN TStyle * gStyle
Definition TStyle.h:412
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition TAttFill.h:37
The Canvas class.
Definition TCanvas.h:23
A 3-Dim function with parameters.
Definition TF3.h:28
virtual void Draw(Option_t *option="")
Draw this function with its current attributes.
Definition TF3.cxx:177
The Formula class.
Definition TFormula.h:87
The most important graphics class in the ROOT system.
Definition TPad.h:26
TVirtualPad * cd(Int_t subpadnumber=0) override
Set Current pad.
Definition TPad.cxx:603
void Draw(Option_t *option="") override
Draw Pad in Current pad (re-parent pad if necessary).
Definition TPad.cxx:1299
A Pave (see TPave) with a text centered in the Pave.
Definition TPaveLabel.h:20
virtual void Draw(Option_t *option="")
Draw this pavelabel with its current attributes.
void SetCanvasPreferGL(Bool_t prefer=kTRUE)
Definition TStyle.h:325
TF1 * f1
Definition legend1.C:11
Timur Pocheptsov

Definition in file gltf3.C.