How do I do this in .net topology suite or jts? Please see image.
Any other library that can I run on .NET is fine, or even a general algorithm if there is no option.
For example this answer is only for endpoints: Check if line crosses a polygon
Right now I'm randomly experimenting and if i intersect and check
it seems to work, but... yeah no idea why or if it's all cases.