title: Finding Normal of Sphere in Ray Tracer Porgram
body: <p>I'm working on a ray tracer for spheres and I'm trying to implement an illuminate function to calculate the light intensity per ray. I'm currently stuck on calculating the diffuse reflection:</p>
  
  <p>Given a ray R, a sphere S, a point P where R intersects S, and a light source L</p>
  
  <p>I understand that to use Lambert's Law to calculate diffuse reflection, I need the light direction vector and the normal vector. </p>
  
  <p>I know I can get the light direction vector by calculating L - P. I'm stuck now on calculating the normal. </p>
  
  <p>I know I need to use the inverse of the S transform matrix but I don't understand conceptually what inverting the S transform matrix does so I was hoping to get some guidance on how to do this. </p>