How do I calculate the length of a vertical offset of the major axis in an elllipse?

Please forgive my terms if it is inaccurate. In the layout listed below, for well-known values of X, Y and also Z, I am require to compute the value (size) of M. (It is not research, it is for an SVG computer animation )