Quote Originally Posted by Clootie
TVector.SetLength should be better implemented as:
[pascal]function TVector.SetLength( LengthLimit : TScalar ) : TVector;
begin
result := Scale( (LengthLimit*LengthLimit) / LengthSquare );
end;[/pascal]
Unfortunately, no. You don't get the same result. For example, let's say the vector is 3 units long and we want to make it 4 units.

Scale := Limit / Length := 4 / 3 := 1.3
Scale := (Limit * Limit) / LengthSquare := (4 * 4) / (3 * 3) := 16 / 9 := 1.7

Different scale values. The first one is correct.

Hmmm, something really wrong with:
[pascal]procedure TVector.Reflection( const normal : TVector; var aReflectionVector : TVector );
begin
...
aReflectionVector.Scale( Length );
aReflectionVector.Normalize; // normalize this vector
...
end;[/pascal]
Yes. Scaling then normalizing means the scale is a wasted operation.