[BezierCurve] Add getDerivative(), move(), rotate() and scale().

This commit is contained in:
vrld
2013-08-21 21:44:31 +02:00
parent aa53712278
commit 983496238f
4 changed files with 109 additions and 1 deletions
+25
View File
@@ -48,6 +48,11 @@ public:
return controlPoints.size() - 1;
}
/**
* @returns First derivative of the curve.
*/
BezierCurve getDerivative() const;
/**
* @returns i'th control point.
**/
@@ -68,6 +73,26 @@ public:
**/
void insertControlPoint(const Vector &point, int pos = -1);
/**
* Move the curve.
* @param t Translation vector.
*/
void translate(const Vector &t);
/**
* Rotate the curve.
* @param phi Rotation angle (radians).
* @param center Rotation center.
*/
void rotate(double phi, const Vector &center);
/**
* Scale the curve.
* @param s Scale factor.
* @param center Scale center.
*/
void scale(double phi, const Vector &center);
/**
* Evaluates the curve at time t.
* @param t Curve parameter, must satisfy 0 <= t <= 1.