As Roger Federer contemplated the challenge of returning to competition after six months on the sidelines, even the best player in history needed to look for inspiration. He found it when he travelled to Majorca in October to help launch Rafael Nadal’s new academy.

“You’ve done it a million times, so I can be inspired by the way you made it look so easy when you came back,” Federer told his greatest rival at the opening ceremony. “You came back to the world’s top 10, top five, even world No 1. That’s something that I’m going to be thinking about when I come back to the tour in January.”

At the time, with Federer recovering from a knee injury and Nadal about to curtail his 2016 campaign because of a wrist problem, the 35-year-old Swiss and the 30-year-old Spaniard joked that all they were fit for was a brief game of mini tennis with the academy’s juniors.

Three months on, however, the two biggest names in tennis are preparing to rekindle their rivalry on one of the sport’s great stages. When they contest the Australian Open final here on Sunday it will be their ninth meeting in Grand Slam finals, with Federer aiming to add to his lone two victories, at Wimbledon in 2006 and 2007. Federer will be the oldest men’s Grand Slam singles finalist for 43 years.

Men’s tennis has been dominated by the so-called “Big Four” for more than a decade now, but in truth it is a two-division super league. Andy Murray and Novak Djokovic are currently the world No 1 and No 2 respectively, but in terms of global appeal, Federer and Nadal have remained the sport’s greatest attractions, despite their comparative lack of success in recent times.

Federer has won 17 Grand Slam titles but has added just one (Wimbledon in 2012) since he claimed his fourth Australian Open seven years ago. Nadal, with 14 Grand Slam titles to his name, has not made a major final since he won his ninth French Open in 2014.

While Nadal is closer in age to Murray and Djokovic, who are only a year younger than him, the Spaniard’s greatest rivalry has always been with Federer, despite their five-year age gap. Because of Nadal’s precocity and Federer’s comparatively late development, their careers have largely followed parallel lines. Federer did not win his first Grand Slam title (at Wimbledon) until a month before his 22nd birthday, while Nadal won his first (at Roland Garros) just days after his 19th.

From the earliest days there was the greatest respect between the two men. They met for the first time in the Miami Masters in 2003, when 16-year-old Nadal won 6-3, 6-3. Federer’s post-match analysis of his opponent that day neatly summed up the qualities that would soon make him a great champion.

“He doesn’t hit the ball flat and hard,” Federer said. “It’s more with a lot of spin, which makes the ball bounce high, and that’s a struggle I had today. His forehand is for sure his biggest shot in his game, and his all-court speed.”

Federer might have already appreciated the difficulty he would have for years to come coping with Nadal’s crunching forehand, struck with such vicious top spin. That one stroke alone is probably the biggest reason why Nadal has won 23 of his 34 meetings with Federer. Particularly on clay, where the top spin helps the ball bounce up to shoulder height, the Nadal forehand causes Federer problems on his backhand which the Swiss has never seemed quite able to resolve.

Roger Federer has always struggled against Nadal on clay (Getty)

Federer lost nine of their first 10 meetings on clay and won a total of just three sets in losing all four of their finals at the French Open between 2006 and 2011. His 6-1, 6-3, 6-0 defeat in the Roland Garros final of 2008 was his heaviest in the 364 matches he has played in Grand Slam competition and he admitted this week that the hidings he took from Nadal on clay affected their matches on other surfaces.

“Maybe that was why I lost the Wimbledon final in 2008,” Federer said. “He crushed me at the French Open final and I think it affected my first two sets at Wimbledon. Maybe that’s why I ended up losing. Rafa played great in that final. I actually ended up playing great too, but I wasn’t fighting the right way. I think that was the effect of being crushed at the French Open.”

Even if you strip out their results on clay Nadal has the upper hand in their head-to-head record, having won 10 of their 19 meetings on grass or hard courts. Federer, nevertheless, thinks that any mental advantage the Spaniard enjoyed in the past is no longer relevant, particularly on the quick courts here at Melbourne Park. “Now it’s a different time,” Federer said. “A lot of time has gone by. I know this court allows me to play a certain game against Rafa that I cannot do on centre court at the French Open.”

The contrast of the two players’ styles and personalities has helped to capture the worldwide public’s imagination. Federer, who glides across the court, is the ultimate attacking player, always looking to be the aggressor, ready to attack the net and to impose his game on his opponent.

The left-handed Nadal, meanwhile, has been a classic counter-puncher who pounds across the court to chase down balls as if his life depends on it and then turns brick-wall defence into razor-sharp attack with one huge swing of his racket. Given his intensely physical game, it is no surprise that Nadal’s career has been frequently interrupted by injuries.

Perhaps the only similarities between the two men on court are their ferocious competitiveness and coolness under pressure, though they also clearly share a deep love of competition. The joy both have shown in winning their matches here over the last fortnight has lit up the tournament.

Nadal has been back to his best after a succession of issues (Getty)

“It’s the combination of two different styles that makes our matches really special,” Nadal said. “They are different ways to play tennis and we’ve both had a lot of success playing in these two different styles.”

In many respects Nadal and Federer are unlikely soul-mates. Nadal enjoys a simple life and simple pleasures. He has lived all his life in the unpretentious town of Manacor on the island of Majorca. Away from tennis he loves nothing more than to be back home with his family and friends, playing golf and fishing.

Federer, in contrast, is suave and sophisticated. He was named GQ’s “Most Stylish Man” of 2016, despite the fact that he spent half the year out of the limelight because of injury. Fluent in German, French and English, he is comfortable in any company. When the Queen visited Wimbledon it was no surprise when Federer was invited to sit next to her at lunch.

Meanwhile Nadal’s humility contrasts with Federer’s appreciation – in a realistic rather than an arrogant way – of his own stature. When he met Diego Maradona back stage at the World Tour Finals in London Federer said the Argentinian was “a big fan of mine” and added: “I think he was almost more excited to meet me than I was to meet him – and I was very excited.”

Federer described Nadal as “an incredible tennis player”. He added: “He’s got shots that no other player has. When you have that, you are unique and special. Plus he’s got the grit. He’s got the mental and physical ability to sustain a super high level of play for years and for hours and for weeks. He's proven that time and time again. He's come back from many injuries, time and time again. He made it seem easy - and it’s not. I think he’s been tremendous for the game. I have a lot of respect for him on many levels.”