# Crossing point of two signals(function)

**URL:** <https://root-forum.cern.ch/t/crossing-point-of-two-signals-function/33805>\
**Category:** Newbie\
**Created:** [April 29, 2019, 9:05am UTC](https://root-forum.cern.ch/t/crossing-point-of-two-signals-function/33805 "2019-04-29T09:05:33Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [April 30, 2019, 10:51am UTC](https://root-forum.cern.ch/t/crossing-point-of-two-signals-function/33805/22 "2019-04-30T10:51:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AA360c](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/aa360c/32/18471_2.png) [@AA360c](https://root-forum.cern.ch/u/AA360c)\
**Post date:** [April 30, 2019, 11:04am UTC](https://root-forum.cern.ch/t/crossing-point-of-two-signals-function/33805/23 "2019-04-30T11:04:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [April 30, 2019, 11:10am UTC](https://root-forum.cern.ch/t/crossing-point-of-two-signals-function/33805/24 "2019-04-30T11:10:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [April 30, 2019, 11:30am UTC](https://root-forum.cern.ch/t/crossing-point-of-two-signals-function/33805/25 "2019-04-30T11:30:00Z")

</div>

Hi,

I have no problem running the macro on Windows:

```auto
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.

---

<div class="post-metadata">

**Author:** ![AA360c](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/aa360c/32/18471_2.png) [@AA360c](https://root-forum.cern.ch/u/AA360c)\
**Post date:** [May 14, 2019, 8:35am UTC](https://root-forum.cern.ch/t/crossing-point-of-two-signals-function/33805/26 "2019-05-14T08:35:53Z")

</div>

@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](https://root-forum.cern.ch/uploads/default/original/3X/1/6/1623dfc34307c326cee878f66a0357834d0c7969.txt) (999.7 KB)  
[Output2.txt](https://root-forum.cern.ch/uploads/default/original/3X/6/6/66d9e490982a65924698e500b78c249eb4202156.txt) (875.2 KB)

Thank you.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [May 14, 2019, 8:51am UTC](https://root-forum.cern.ch/t/crossing-point-of-two-signals-function/33805/27 "2019-05-14T08:51:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![AA360c](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/aa360c/32/18471_2.png) [@AA360c](https://root-forum.cern.ch/u/AA360c)\
**Post date:** [May 14, 2019, 9:02am UTC](https://root-forum.cern.ch/t/crossing-point-of-two-signals-function/33805/28 "2019-05-14T09:02:11Z")

</div>

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

Thanks again.

[Previous page](https://root-forum.cern.ch/t/crossing-point-of-two-signals-function/33805.md?page=1)
