I have a child object on XZ plane of its parent object. When I rotate the child object around Y-axis, I would like to know its (local) position that is relative to its direction (as if the plane was rotated with it). I need to get negative relative position values as well, not just distance. Here’s an illustration (on XY plane instead of XZ):

I tried this to find where the lines meet and find the distance of these lines, but they’re always positive.
How could I solve this issue? or is there an even better way I could do this with an integrated function?
Thanks!