Pergunta de entrevista da empresa Hadrian

a 3d mathematics question i had to solve