# Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Finding an intersection of two lines and parenting it

• # Finding an intersection of two lines and parenting it

Posted by on June 3, 2020 at 11:11 am

Hi, I am attempting to create a Lissajous curve table like the example driven by expressions.
By rotating a point at different speeds around a circle and tracing the x and y position from each it will generate different curves.

What I am struggling with is finding the the intersection of the x and y guides in red to then parent a shape layer to and use something like trails to draw them https://aescripts.com/trails/

I have created the below by parenting the x and y guides to the radius of each circle that has a rotation applied and then offsetting it by the rotation speed so they don’t rotate.

Doing this removes the ability to easily access the x or y position of the guides as they are being driven by rotation which makes me question if this is the best method?

Thanks.

`thisComp.layer("radius").transform.rotation*-1`

``` ```

`thisComp.layer("radius").transform.rotation*-1.5-90`

2 Members · 2 Replies
• 2 Replies
• ### Robert Müller

June 3, 2020 at 1:32 pm

Hi,
this should work just fine, you need to access the global position of your guides. I made a setup parenting a small white circle on an outlined one, driven by the rotation:
``` xC=thisComp.layer("x1c"); //small white circle 1; For the X value yC=thisComp.layer("y1c"); //small white circle 2; For the Y value x=xC.toComp(xC.anchorPoint)[0]; //getting the global X value y=yC.toComp(yC.anchorPoint)[1]; //getting the global Y value [x,y]```

I added this expression to the position of a null which then I can trace using Write-on or the plugin you linked.

• ### John Burgess

June 3, 2020 at 3:53 pm

Hi Robert

This worked perfectly, thank you so much.

We use anonymous cookies to give you the best experience we can.