What exactly is the formula for determining home financing re payment?

What exactly is the formula for determining home financing re payment?

The homeloan payment calculation appears like this:

M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1]

The factors are the following: