Richter scale magnitude calculation