Daniel
2012-03-09 07:06:48
Hi there,
While going through the include, I couldn't help but notice that you passed wrong parametres to the ArcTan method in AngleBetween.
v1.y should be before v1.x!
New:
Easier way to put it:
I changed:
Regards,
Daniel :)
While going through the include, I couldn't help but notice that you passed wrong parametres to the ArcTan method in AngleBetween.
v1.y should be before v1.x!
New:
function AngleBetween(v1, v2: TVector): Extended; overload;
var
a1, a2: Extended;
begin
a1 := ArcTan2(v1.y, v1.x);
a2 := ArcTan2(v2.y, v2.x);
Result := fixRad(a1 - a2)
end;
Easier way to put it:
function AngleBetween(const v1, v2: TVector): Extended; overload;
begin
Result := FixRad(ArcTan2(v1.y, v1.x) - ArcTan2(v2.y, v2.x));
end;
I changed:
a1 := ArcTan2(v1.x, v1.y);
a2 := ArcTan2(v2.x, v2.y);
..to the above.Regards,
Daniel :)