B-Splines are simple recursion. NURBS are a bit trickier and probably require some messy chain-ruling for the weights. See https://github.com/StandardCyborg/nurbs/tree/initial#references