Hamilton sealed his fourth world championship last week with a ninth-place finish at the Mexican Grand Prix.
It capped a dominant year for the British driver after the disappointment of losing the 2016 title to Nico Rosberg.
In an interview with Spanish outlet AS, Hamilton opened up on the importance of mental strength and name-checked Federer and Nadal.
He said: “When you look at the great champions of tennis or golf you realise that mental power is everything is the mind that controls what you do.
“Stars like Nadal or Federer are an example for everyone and I try to inspire myself in what they do.”
The 32-year-old also spoke out about his relationship with Sebastian Vettel, who was his closest rival in the Ferrari this season.
He said: “My relationship with Vettel is correct, we are not twenty years old, we are adult men.
“If I think of Sebastian, I know what he has done in recent years, I know how what it is and what its strengths and weaknesses are, and I also know the strengths and weaknesses of your car.”
And Hamilton feels that combating negativity is the key to his success.
He added: “Now I try to eliminate everything harmful, regardless of what they write or say.
“I have managed to make myself a barrier to combat negativity because I am convinced that love and positivity can with everything and everyone.”