Fixed #83
Merge pull request #87 from CyberCRI/correct-raytracing

Fixed raytracing algorithm