I really have to say, what a pile of shit, that sourcecode is, before I even begin to explain how it really works - I hate API that hide math behind constructs like that - no mention of a dot product

```
float lenSquared = LengthSquared();
```

That hideous looking thing, is really, float lenSquared = dot (this vector, and also this vector);

One thing we do learn on the way, is that the dot product of a vector with itself, is its squared length, which we can only learn, by learning how the math works.