Stick a line on a polyline with kangaroo

I’m very new to Kangaroo , have tried a lot of things, seen several tutos, but did not find what I need:
I have a quite simple need I guess:
I need to find the minimum angle between reference line and red line, where:

  • the red Line is in contact with polyline (Contact Point).
  • Rotation centre is the polyline lowest point (Bot Point),
  • contact point should be at a minimum distance “Dmin” from Bottom point.
    How can I get this in Kangaroo?
    Thanks in advance for your help!