Crossing point of two signals(function)

I am not working on windows myself. May be @bellenot might see something I missed.

1 Like

@couet // Okay. I’ll ask him. You have my thanks. :rose::rose::rose:

No need to ask. He will see I mentioned his name in this thread

1 Like

Hi,

I have no problem running the macro on Windows:

C:\Users\bellenot\Downloads>root -l intersect.C
root [0]
Processing intersect.C...
Info in <TCanvas::MakeDefCanvas>:  created default TCanvas with name c1
Plot1 and Plot2 might intersect at (34284, 15)
Plot1 and Plot2 might intersect at (34285, 16)
root [1]

Cheers, Bertrand.

1 Like

@couet // Hi again.
I have another prob with those file. I changed some of parameter in my code and now i have 2 new txt file. everything is like before. but the intersect.C can not work. I mean intersect.C give nothing as answere.

I think the problem arises where in both file the first data points are the same and equal to zero. I think the Intersect.C can not distinguish between them because there is to many identical point. could we define a definite area for intersect.C and say find the intersect there ?

I mean something like if statement in C++

Those new txt file are following :

Output1.txt (999.7 KB)
Output2.txt (875.2 KB)

Thank you.

Have you changed min and max ? The intersection of the new data you sent is not in the range defined by the min and max value I put in my initial post.
The code I sent you was just a small example showing some idea to find the intersection .
Up to you to modify it as you need.

1 Like

@couet // Omg. What a foolish mistake !!! You’re right.

Thanks again.