ATP and WTA ranking points algorithm

How are tennis’ ranking ATP and WTA ranking points calculated? I presume you get more points for beating a better ranked player - is that so? Do you also get points for what stage of a tournament the match is in? Do Grand Slams attract more points?

Is the algorithm easy enough for a reasonably educated human to look at the stats, look at the matchup and work out the ranking points, or do you realistically need the help of Intel? Could it really be a simple as calculating positions on a soccer or baseball league?

No. It goes by what stage of the tournament you get to.

Yes. You can see where Rafael Nadal’s points come from here. This shows that he got 2,000 for winning each of Wimbledon last year and the Australian Open. In contrast, winning a Masters Series event gets 1,000 points. Winning Barcelona gets him 500 points.

18 results count, but for the top players these must include the Grand Slam and Masters Series events. There are more rules, but you can find those on the web site I linked to above.

Every Monday, the results from 53 weeks ago are dropped and replaced with the most recent week. On July 6 Nadal will lose his 2,000 points for winning Wimbledon and they will be replaced with a goose egg.