  We point out that an accurate in situ determination of the earth matter
density \rho is possible in neutrino factory by placing a detector at the magic
baseline, L = \sqrt{2} \pi / G_{F} N_{e} where N_{e} denotes electron number
density. The accuracy of matter density determination is excellent in a region
of relatively large theta_{13} with fractional uncertainty \delta \rho / \rho
of about 0.43%, 1.3%, and \lsim 3% at 1 sigma CL at sin^2 2theta_{13}=0.1,
10^{-2}, and 3 x 10^{-3}, respectively. At smaller theta_{13} the uncertainty
depends upon the CP phase delta, but it remains small, 3%-7% in more than 3/4
of the entire region of delta at sin^2 2theta_{13} = 10^{-4}. The results would
allow us to solve the problem of obscured CP violation due to the uncertainty
of earth matter density in a wide range of theta_{13} and delta. It may provide
a test for the geophysical model of the earth, or it may serve as a method for
stringent test of the MSW theory of neutrino propagation in matter once an
accurate geophysical estimation of the matter density is available.
