kom=(y 1+y2)/(x 1+x2)
Let the straight line be y = kx+b.
Bring in an ellipse, arrange it, and use Vieta's theorem to find x 1+x2. Similarly, you can get y 1+y2.
Or y1+y2 = kx1+b+kx2+b = k (x1+x2)+2b.
Substitute x 1+x2, y 1+y2 into k*kom and you can get it.
However, it is better to add a constraint condition that the discriminant is greater than or equal to 0 when using Vieta theorem, otherwise the straight line and ellipse will not intersect.