Closest Point Between 2 Rays

i just tested and this seems to get within 0.00004% error (or basically 99.99996% accuracy) of the actual intersection point (if applicable) so i think this kind of works, but i’m surprised there isn’t a solidified mathematical way to find the exact intersection point. this will very much work as an approximation, though.

print(
    closestPointRayRay(
        Ray.new(Vector3.new(0,1,0), Vector3.new(2,1,0)), 
        Ray.new(Vector3.new(0,-1,0), Vector3.new(1,1,0))
    )
)
4.000001907348633, 3.0000009536743164, 0