Check for and validate input

Added a check for input. This eliminates the 'undefined key' error that is caused by using $_GET['degree'] and $_GET['scale'] on the initial page load, when these do not exist yet. 

Also added a check that the input is not NULL, and that it is a number.