The Ray Tracer Challenge: Chapter 5 (p. 58) - Point with Distance to Origin

I think the following pseudocode from the book contains a bug:

function​ position(ray, t)
​ 	  ​return​ ray.origin + ray.direction * t
​ end​ ​function​

Isn’t it neccessary to normalize the direction vector first, before scaling it? The associated test case works only, because the given direction vector has already length = 1.

1 Like