Maximally extend a curve to a certain boundary?

Hello, I need help on defining the logic and also what component to use. So the idea is that, I want to extend the start and end of this green highlighted line to the north and south boundary of the site. So, I want to be able to move the highlighted line in X-axis while the length of its Y-axis will always be on max length of the site’s shape. Can anyone help me with the logic? I’ve tried to find similar cases but no luck. The most similar case is to use ‘fillet’ but I think that’s quite subtly for a different purpose.

Thank you!

This is a question that is best asked on the Grasshopper forum as it doesn’t have to do with Ladybug Tools:

It’s also probably worth searching that forum before posting.