Beispiel #1
0
// OPTIMIZE? compute t^2, t(1-t), and (1-t)^2 and pass them to another version of derivative at t?
_Vector dxdy_at_t(const Cubic& cubic, double t) {
    _Vector result = { derivativeAtT(&cubic[0].x, t), derivativeAtT(&cubic[0].y, t) };
    return result;
}
Beispiel #2
0
double dy_at_t(const Quadratic& quad, double t) {
    return derivativeAtT(&quad[0].y, t);
}
Beispiel #3
0
double dy_at_t(const Cubic& cubic, double t) {
    return derivativeAtT(&cubic[0].y, t);
}
Beispiel #4
0
// OPTIMIZE? compute t^2, t(1-t), and (1-t)^2 and pass them to another version of derivative at t?
void dxdy_at_t(const Cubic& cubic, double t, _Point& dxdy) {
    dxdy.x = derivativeAtT(&cubic[0].x, t);
    dxdy.y = derivativeAtT(&cubic[0].y, t);
}