In news you already knew, Stack Overflow is amazing. Instead of reinventing the wheel with trigonometry for half of an hour trying to remember random stuff from college, you can try one of the multiple solutions in a few minutes.
The tricky part is in naming what you are trying to find, ha!
A quick example of what I was trying to achieve today:
https://stackoverflow.com/questions/10301001/perpendicular-on-a-line-segment-from-a-given-point
@eaplmx@twtxt.net What “problem” were you trying to solve that lead you to this wonderful piece of trigonometry that I have zero clues about 😂 Boi am I rusty with “hard math” 😅
@prologic@twtxt.net a soccer/football game.
I guess I’ll overcomplicate it even more, but for now it was the easiest solution for a referee to follow the ball, while they is walking across a line.
Based on: https://www.wikiwand.com/en/Referee_(association_football)#/Positioning_and_responsibilities