This is basic graphics geometry and/or trig, and I feel dumb for asking it, but I can\'t remember how this goes. So:
Based on this article
let x1, x2, y1, y2, slope, xp, yp, m, x, y x1 = 0 y1 = 0 x2 = 50 y2 = -50 xp = 50 yp = 0 slope = (y1 - y2) / (x1 - x2) m = -1 / slope x = (m * xp - yp - slope * x1 + y1) / (m - slope) y = m * x - m * xp + yp console.log('x: ', x, ', y: ', y )