Consider the equation for an axis-aligned ellipse centered at origin:
$$\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1$$
Here, $a$ is the semi-major axis aligned to the $x$ axis, and $b$ is the semi-major axis aligned to the $y$ axis.
Solving for $x$ you get
$$x = \pm \sqrt{ a^2 - \frac{ y^2 a^2 }{ b^2 } } = \pm a \sqrt{ 1 - \left(\frac{y}{b}\right)^2 }$$
and solving for $y$ you get
$$y = \pm \sqrt{ b^2 - \frac{ x^2 b^2 }{ a^2 } } = \pm b \sqrt{ 1 - \left(\frac{x}{a}\right)^2 }$$
The "width" of the ellipse (length of a horizontal chord) at $y$ is $\lvert x-(-x)\rvert$, i.e.
$$L_x(y) = 2 a \sqrt{ 1 - \left(\frac{y}{b}\right)^2 }$$
and the "height" of the ellipse (length of a vertical chord) at $x$ is $\lvert y-(-y)\rvert$, i.e.
$$L_y(x) = 2 b \sqrt{ 1 - \left(\frac{x}{a}\right)^2 }$$
Rotating and translating (moving) the ellipse does not change its shape or the semi-major axes, so this does apply to rotated and translated ellipses too. That is, the equation of a general ellipse is just the first equation rotated and translated. Conversely, any general ellipse can be translated to origin and rotated to have its axes parallel to $x$ and $y$ axes. This is why the above applies to all ellipses.
Let $A$ be the major axis, and $B$ the minor axis, so that $a=A/2$ is the semi-major axis, and $b=B/2$ is the semi-minor axis. (Colloquially, $A$ and $B$ are "diameters", whereas $a$ and $b$ are radii.)
At distance $d$ from the minor axis, the length of the chord parallel to the minor axis is
$$L_A(d) = 2b\sqrt{1-\left(\frac{d}{a}\right)^2} = B \sqrt{1 - \left(\frac{2d}{A}\right)^2}$$
Similarly, the length of the chord parallel to the major axis at distance $d$ is
$$L_B(d) = 2a\sqrt{1-\left(\frac{d}{b}\right)^2} = A \sqrt{1 - \left(\frac{2d}{B}\right)^2}$$