The calculated distance (air line) between Barajas de Madrid and Tres Cantos is approximately 11 miles respectively 18 kilometers.
By car or train, the actual journey to Tres Cantos is certainly longer, as only the direct route (as the crow flies) between Barajas de Madrid and Tres Cantos has been calculated here.
Air line (approximately)
18 kilometers
10 nautical miles