this was used in my recent cloud engine to display off screen players

I've been wondering for a while why you read inputs right to left, and it finally clicked that you speak an RTL language! :~)

thats because hes israeli, and hebrew is right to left

is this intended to work like that ?

I just said that!

Sure, that's where the extension of the blue line intersects the extension of the top edge of the rectangle. I haven't read the code but I'm guessing it works out the equations of the lines that extend the line segments. (It's much harder to make a non-parametric equation that matches only a line segment!)

no the code doesnt check if it intersects only in theory where. you can easily check if it does

yes it is also pointless to do so because it is quite simple to check if the line intersects the box so you can just use that as a bool

I agree in this project. There are mathematical contexts in which it might be nice to have an algebraic representation for a line segment. You can do it based on a sine wave to move back and forth along the segment. I forget the details but it's probably not that hard to figure out. But it's not a y=f(x) kind of equation; it's (x,y)=f(t).