56 #ifdef CHECK_MEMORY_LEAKS
58 #endif // CHECK_MEMORY_LEAKS
65 1.0, 1.0, 2.0, 6.0, 24.0, 120.0, 720.0
79 a[ntop] = a[j1] * ntop;
94 const SUMOReal ti = (i == 0) ? 1.0 : pow(t, i);
95 const SUMOReal tni = (n == i) ? 1.0 : pow(1 - t, n - i);
96 return Ni(n, i) * ti * tni;
116 for (i1 = 1; i1 <= cpts; i1++) {
118 if ((1.0 - t) < 5e-6) {
122 for (j = 1; j <= 3; j++) {
125 for (i = 1; i <= npts; i++) {
126 p[icount + j] = p[icount + j] +
Basis(npts - 1, i - 1, t) * b[jcount];
141 for (
int i = 0; i < (int)init.size(); ++i) {
143 def[i * 3 + 1] = init[i].x();
145 def[i * 3 + 3] = init[i].y();
148 bezier((
int)init.size(), def, numPoints, ret_buf);
151 for (
int i = 0; i < (int)numPoints; i++) {
152 Position current(ret_buf[i * 3 + 1], ret_buf[i * 3 + 3], init[0].z());
153 if (prev != current && !
ISNAN(current.
x()) && !
ISNAN(current.
y())) {
154 ret.push_back(current);
SUMOReal x() const
Returns the x-position.
A point in 2D or 3D with translation and scaling methods.
void bezier(int npts, SUMOReal b[], int cpts, SUMOReal p[])
SUMOReal Basis(int n, int i, SUMOReal t)
SUMOReal Ni(int n, int i)
SUMOReal y() const
Returns the y-position.