  In this paper JK_s data from the VISTA Magellanic Cloud (VMC) survey are used
to investigate the tip of the red giant branch (TRGB) as a distance indicator.
A linear fit to recent theoretical models is used which reads M_{K_s} = -4.196
-2.013 (J-K_s), valid in the colour range 0.75 < (J-K_s) < 1.3 mag and in the
2MASS system. The observed TRGB is found based on a classical first-order and a
second-order derivative filter applied to the binned luminosity function using
the "sharpened" magnitude that takes the colour term into account. Extensive
simulations are carried out to investigate any biases and errors in the derived
distance modulus (DM). Based on these simulations criteria are established
related to the number of stars per bin in the 0.5 magnitude range below the
TRGB and related to the significance with which the peak in the filter response
curve is determined such that the derived distances are unbiased. The DMs based
on the second-order derivative filter are found to be more stable and are
therefore adopted, although this requires twice as many stars per bin. The TRGB
method is applied to specific lines-of-sight where independent distance
estimates exist, based on detached eclipsing binaries in the LMC and SMC,
classical Cepheids in the LMC, RR Lyrae stars in the SMC, and fields in the SMC
where the star formation history (together with reddening and distance) has
been derived from deep VMC data. The analysis shows that the theoretical
calibration is consistent with the data, that the systematic error on the DM is
approximately 0.045 mag, and that random errors of 0.015 mag are achievable.
Reddening is an important element in deriving the distance: we find mean DMs
ranging from 18.92 (for a typical E(B-V) of 0.15 mag) to 19.07 mag (E(B-V)
about 0.04) for the SMC, and ranging from 18.48 (E(B-V) about 0.12 mag) to
18.57 mag (E(B-V) about 0.05) for the LMC.
