Re: [ROOT] TF1 with severals TFormula

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Mar 15 2001 - 16:26:33 MET


Hi Maria,
Yes, this is possible, for example the implementation of your eaxmple
could be:

 root > TF1 f1("f1","(x<=1)*(x+1) +(x>1 && x<=10)*x*x + (x>10)*sqrt(x)",0,20)
 root > f1.Draw()

Rene Brun

Maria Jesus MORA wrote:
> 
>         Dear all;
> 
>     I am wondering if in the TF1 class exist the possibility to create a
> function with several formulae inside (for differents windows in x). The
> equivalent to:
> 
>             /
>             |   x+1.      0.<x<=1.
>             |
> f(x) =  |  x^2        1.<x<=10.
>             |
>             |  sqrt(x)   10.<x<=20.
>             \
> 
> for instance.....
>     Thanks,
> 
> Maria MORA



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:39 MET