Ray/sphere intersection

Please take a look and feel free to make any necessary changes, or let me know and I'll modify it.