https://image3.slideserve.com/6608719/calculating-the-number-of-basis-functions-t.jpg