Length of chord on ellipse Suppose I have an ellipse centered at the origin, preferably expressed in its matrix form, and I want to know the chord length of a segment that passes through the origin with the endpoints at the ellipse, of which I know the angle theta. How can I compute it? Thank you!
If your chord makes an angle $\phi$ with the $x$-axis, then its length is
$$
\frac{2ab}{\sqrt{  {b^2}\cos^2{\phi} + {a^2}\sin^2{\phi}  }}
$$
See this answer for a bit more detail.

The angle $\theta$ used in apurv's answer is not the angle between the chord and the $x$-axis. That's probably the reason for his question, where he asked you what you mean by "theta".
The answer from Bubba assumes the chord passes through the center, so it's actually a diameter.  If you start with parametric equations [x,y]=R*[cos(phi),sin(phi)], substitute them into the equation for an ellipse, and solve for R, you get half of Bubba's answer.