double calcBezier(double aT, double aA1, double aA2) { return (((1.0 - 3.0 * aA2 + 3.0 * aA1) * aT + (3.0 * aA2 - 6.0 * aA1)) * aT + (3.0 * aA1)) * aT; }