added magnitude function
Merge pull request #5 from ffranco54/master

added magnitude function by Francisco