7 template <
typename T,
int DIM,
int NUM_CTR_PT>
14 for (
int j(0); j < NUM_CTR_PT; ++j) {
15 for (
int i(0); i < DIM; ++i) {
27 for (
int j(0); j < NUM_CTR_PT; ++j) {
28 for (
int i(0); i < DIM; ++i) {
29 _CtrlPt[j][i] = ctrl_pt[j][i];
38 for (
int i(0); i < DIM; ++i) {
39 ret[i] = _CtrlPt[NUM_CTR_PT - 1][i];
43 for (
int i(0); i < DIM; ++i) {
44 ret[i] = _CtrlPt[0][i];
49 for (
int i(0); i < DIM; ++i) {
51 for (
int j(0); j < NUM_CTR_PT; ++j) {
52 ret[i] += _coeff[j] * pow(u, j) * pow(1 - u, (NUM_CTR_PT - 1) - j) *
62 for (
int i(0); i < DIM; ++i) {
67 for (
int i(0); i < DIM; ++i) {
73 for (
int i(0); i < DIM; ++i) {
76 (-(NUM_CTR_PT - 1) * pow(1 - u, (NUM_CTR_PT - 1) - 1)) *
78 for (
int j(1); j < NUM_CTR_PT - 1; ++j) {
80 (j * pow(u, j - 1) * pow(1 - u, (NUM_CTR_PT - 1) - j) -
81 (NUM_CTR_PT - 1 - j) * pow(u, j) *
82 pow(1 - u, (NUM_CTR_PT - 1) - j - 1)) *
85 ret[i] += _coeff[NUM_CTR_PT - 1] * (NUM_CTR_PT - 1) *
86 pow(u, NUM_CTR_PT - 2) * _CtrlPt[NUM_CTR_PT - 1][i];
97 for (
int i(1); i < n + 1; ++i) ret *= (i);
bool SetParam(T **ctrl_pt, T fin_time)
bool getCurvePoint(T u, T *ret)
T _CtrlPt[NUM_CTR_PT][DIM]
bool getCurveVelocity(T u, T *ret)
int _factorial(const int &n)