multi-dimensional trig basis density generation and some plotting routines