A triangle theorem by Fermat