Text this: On a strict mathematical definition of the brachistochrone’s shape taking into account the thermal effect in the contact zone