<p>OK, I can't do the maths, so I'm going straight to hell for this terrible hack instead:</p>
<ol>
<li>Make a solid the size of your comp</li>
<li>Make a shape layer containing two curves the shape of Path A and Path B.  Make them have some thickness (a few pixels).</li>
<li>Put the shape layer above the white solid.</li>
<li>Set the white solid to Alpha Invert Track Matte, so two holes are cut in it, using the shape layer to cut them. The shape layer will automatically become invisible.</li>
</ol>
<p><a href="https://i.sstatic.net/NHpi5.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/NHpi5.png" alt="enter image description here" /></a></p>
<ol start="5">
<li>Put a bright red vertical line behind your white background.  Animate it from left to right.</li>
<li>Add another white solid as the bottom layer, as a background so you can't see the holes.</li>
</ol>
<p><a href="https://i.sstatic.net/eufCE.gif" rel="nofollow noreferrer"><img src="https://i.sstatic.net/eufCE.gif" alt="enter image description here" /></a></p>
<p>Pre-comp all of the above.</p>
<p>In your master comp which now contains only your new precomp, use the Tracker to Track Motion on your PreComp.<br />
Track the small red dots that cut through the holes.
Attach both trackers to nulls, etc.</p>
<p>It's really ugly but it works:</p>
<p><a href="https://i.sstatic.net/WDjkZ.gif" rel="nofollow noreferrer"><img src="https://i.sstatic.net/WDjkZ.gif" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2022-03-27T13:05:13.317Z
Hi tomh, thank you for your help. That will work but i didn't clarify that i need a parametric solution cause i need to create multiple graph very quickly. I already have the expression to let the point A follow the path A. Of course I can use the same expression for point B and path B, but in some way i need to set extra math to make point B aligned to point A on vertical axis during time.
mattia c
CC BY-SA 4.0
2022-03-27T16:08:54.560Z
I think with the right use of comps, you could parameterise  this method
tomh
CC BY-SA 4.0
2022-03-25T16:08:56.393Z
2022-03-25T16:08:56.393Z
tomh
<p>Hoped this is useful to you
even if it's quite late<a href="https://i.sstatic.net/Vi32a.gif" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Vi32a.gif" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2023-01-17T18:38:50.157Z
Welcome! Please summarize the contents of the linked GIF in case it becomes unavailable in the future.
Michael Liebman
CC BY-SA 4.0
2023-01-16T01:43:55.687Z
2023-01-16T01:43:55.687Z
Tarotms 
<p><a href="https://i.sstatic.net/w7h4t.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/w7h4t.jpg" alt="enter image description here" /></a></p>
<p>I have two curves/paths (path A and B) and a null point A that follows path A with an arbitrary speed.</p>
<p>I need a null point B that follows the path B but with a speed dependent to null point A x position. In other words, point B must follow the path B but accordingly to point A x position.</p>
<p>As you see in the image, at time 0 and 1, point B has the x position shared with point A  while point B y position is on the intersection of the vertical axis, passing trough point A, and path B.</p>
<p>I need an expression for null point B position that can do that.</p>
<p>Thank you for your help.</p>

CC BY-SA 4.0
2022-03-25T14:30:07.890Z
Have you looked at path point expressions?  The video on this page looks like it would get you most of the way there.  https://pixelsandpaths.com/posts/tutorials/path-point-expression-language-in-after-effects/
tomh
CC BY-SA 4.0
2022-03-25T15:15:22.480Z
Hmm.. That's a tricky one.  I can track the red path if I parent both sliders together, but then the x positions go out of sync.  Or I can track the x position of A onto B, but then B doesn't follow its own path correctly.  Bet @stib knows.
tomh
<after-effects><after-effects-expressions>
After Effects: Detect point of intersection between two paths
mattia c
# After Effects: Detect point of intersection between two paths

(Asked by: username_0 on 2022-03-25)

[![enter image description here](https://i.sstatic.net/w7h4t.jpg)](https://i.sstatic.net/w7h4t.jpg)

I have two curves/paths (path A and B) and a null point A that follows path A with an arbitrary speed.

I need a null point B that follows the path B but with a speed dependent to null point A x position. In other words, point B must follow the path B but accordingly to point A x position.

As you see in the image, at time 0 and 1, point B has the x position shared with point A while point B y position is on the intersection of the vertical axis, passing trough point A, and path B.

I need an expression for null point B position that can do that.

Thank you for your help.

**Tags:** after-effects, after-effects-expressions

> **Comments:**
> **username_1**: Have you looked at path point expressions?  The video on this page looks like it would get you most of the way there.  https://pixelsandpaths.com/posts/tutorials/path-point-expression-language-in-after-effects/  
> **username_1**: Hmm.. That's a tricky one.  I can track the red path if I parent both sliders together, but then the x positions go out of sync.  Or I can track the x position of A onto B, but then B doesn't follow its own path correctly.  Bet @stib knows.  

---

## 2 answers

### Answer by username_1 on 2022-03-25. Score: 0

OK, I can't do the maths, so I'm going straight to hell for this terrible hack instead:

1. Make a solid the size of your comp
2. Make a shape layer containing two curves the shape of Path A and Path B. Make them have some thickness (a few pixels).
3. Put the shape layer above the white solid.
4. Set the white solid to Alpha Invert Track Matte, so two holes are cut in it, using the shape layer to cut them. The shape layer will automatically become invisible.

[![enter image description here](https://i.sstatic.net/NHpi5.png)](https://i.sstatic.net/NHpi5.png)

5. Put a bright red vertical line behind your white background. Animate it from left to right.
6. Add another white solid as the bottom layer, as a background so you can't see the holes.

[![enter image description here](https://i.sstatic.net/eufCE.gif)](https://i.sstatic.net/eufCE.gif)

Pre-comp all of the above.

In your master comp which now contains only your new precomp, use the Tracker to Track Motion on your PreComp.  
Track the small red dots that cut through the holes.
Attach both trackers to nulls, etc.

It's really ugly but it works:

[![enter image description here](https://i.sstatic.net/WDjkZ.gif)](https://i.sstatic.net/WDjkZ.gif)

> **Comments:**
> **username_0**: Hi username_1, thank you for your help. That will work but i didn't clarify that i need a parametric solution cause i need to create multiple graph very quickly. I already have the expression to let the point A follow the path A. Of course I can use the same expression for point B and path B, but in some way i need to set extra math to make point B aligned to point A on vertical axis during time.  
> **username_1**: I think with the right use of comps, you could parameterise  this method  

---

### Answer by username_2 on 2023-01-16. Score: 0

Hoped this is useful to you
even if it's quite late[![enter image description here](https://i.sstatic.net/Vi32a.gif)](https://i.sstatic.net/Vi32a.gif)

> **Comments:**
> **username_3**: Welcome! Please summarize the contents of the linked GIF in case it becomes unavailable in the future.  

---

