```r
x=rep(0:40,4)
x2=-20:20
y=c(-0.02*I(x2^2)+25.5,
    0.04*I(x2^2)+15.5,
    0.02*I(x2^2)+15.5,
    0.02*I(x2^2)+5.5)
polyn.df=data_frame(x,y,type=rep(c("a","b","c","d"),each=41))
e=ggplot(polyn.df)+
  aes(x=x,y=y,col=type)+
  geom_point()
polyn.coefs=polyn.df%>%
  group_by(type)%>%
  do(data_frame(DCT = emuR::dct(.$y,m=2,fit=F))) %>%
  mutate(DCTCOEF = paste0("k",0:(table(type)-1))) %>%
  tidyr::spread(DCTCOEF, DCT)
f=ggplot(polyn.coefs)+
  aes(x=type,y=k2,fill=type)+
  geom_col()+
  ggtitle("k2 corresponds to CURVATURE")
```