# TF1 intersection

**URL:** <https://root-forum.cern.ch/t/tf1-intersection/5795>\
**Category:** ROOT\
**Created:** [December 15, 2007, 3:41pm UTC](https://root-forum.cern.ch/t/tf1-intersection/5795 "2007-12-15T15:41:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![brun](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/b9e5f3/32.png) [@brun](https://root-forum.cern.ch/u/brun)\
**Post date:** [December 15, 2007, 4:26pm UTC](https://root-forum.cern.ch/t/tf1-intersection/5795/2 "2007-12-15T16:26:37Z")

</div>

see example below

```auto
TF1 *f1, *f2;
double finter(double *x, double*par) {
   return TMath::Abs(f1->EvalPar(x,par) - f2->EvalPar(x,par));
}
void fint() {
   f1 = new TF1("f1","1+2*x+0.2*x*x",0,10);
   f2 = new TF1("f2","6+3*x-0.3*x*x",0,10);
   f1->Draw();
   f2->Draw("same");
   TF1 *fint = new TF1("fint",finter,0,10,0);
   double xint = fint->GetMinimumX();
   fint->Draw("lsame");
   TMarker *m = new TMarker(xint,f1->Eval(xint),24);
   m->SetMarkerColor(kRed);
   m->SetMarkerSize(3);
   m->Draw();
   printf("xint=%g\n",xint);
}

```

Rene

---

_[View the full topic](https://root-forum.cern.ch/t/tf1-intersection/5795)._
