- Added alamo speedway (based on texas speedway)

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@6078 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: cd2251764f3c1566e585143cf513f9164dbe6292
Former-commit-id: a6e56728b070fe8909f490898a0efe46d7fa6bc3
This commit is contained in:
torcs-ng 2015-08-19 22:10:00 +00:00
parent 7c17847913
commit 7164078e4f

View file

@ -114,7 +114,11 @@ double Utils::CalcCurvature( double p1x, double p1y, double p2x, double p2y, dou
double sx = p3x - p1x;
double sy = p3y - p1y;
double K = (2 * (px * qy - py * qx)) / sqrt((px * px + py * py) * (qx * qx + qy * qy) * (sx * sx + sy * sy));
double divider = sqrt((px * px + py * py) * (qx * qx + qy * qy) * (sx * sx + sy * sy));
if (divider == 0.0)
return 0.0;
double K = (2 * (px * qy - py * qx)) / divider;
return K;
}