Contactless distance measurement method