functional language for computing with geometry
DEF PeriodicBsplineGraph =
STRUCT ~ [ MAP:[u,B4], MAP:[u,B3],
MAP:[u,B2], MAP:[u,B1],
K:((@1~CUBOID):<1,1>) ]
WHERE
B1 = a * ((k:3*u2) - (k:1*u3) - (k:3*u) + (k:1)),
B2 = a * ((k:3*u3) - (k:6*u2) + (k:4)),
B3 = a * ((k:3*u2) - (k:3*u3) + (k:3*u) + (k:1)),
B4 = a * u3,
u = s1, u2 = u*u, u3 = u2*u, a = k:1/k:6
END;
PeriodicBsplineGraph:(Intervals:1:20);