######################################
# nodes and weight for points = 3, 5, 7, 15 and 21.
######################################
GK.nodes<-function(points){
if(points==15){
gk.n <- c(-0.991455371120813, -0.949107912342758, -0.864864423359769,
-0.741531185599394, -0.586087235467691, -0.405845151377397,
-0.207784955007899, 0, 0.207784955007899, 0.405845151377397,
0.586087235467691, 0.741531185599394, 0.864864423359769,
0.949107912342758, 0.991455371120813)
gk.w <- c(0.0229353220105292, 0.0630920926299785, 0.10479001032225,
0.140653259715526, 0.169004726639268, 0.190350578064785,
0.204432940075299, 0.209482141084728, 0.204432940075299,
0.190350578064785, 0.169004726639268, 0.140653259715526,
0.10479001032225, 0.0630920926299785, 0.0229353220105292)
}
if(points==5){
gk.n<- c(0.9061798459,-0.9061798459,0.5384693101,-0.5384693101,0)
gk.w<-c(0.2369268851,0.2369268851,0.4786286705,0.4786286705,0.5688888888)
}
if(points==3){
gk.n<- c(0,-0.7745966692414834,0.7745966692414834)
gk.w<-c(0.8888888888888888,0.5555555555555556,0.5555555555555556)
}
if(points==7){
gk.n<- c(0.9491079123,-0.9491079123,0.7415311856,-0.7415311856,0.4058451514,-0.4058451514,0)
gk.w<-c(0.1294849662,0.1294849662,0.2797053915,0.2797053915,0.3818300505,0.3818300505,0.4179591837)
}
if(points==21){
gk.n<-c(0.000000000000000000000000000000000e+00,
1.488743389816312108848260011297200e-01, -1.488743389816312108848260011297200e-01,
2.943928627014601981311266031038656e-01, -2.943928627014601981311266031038656e-01,
4.333953941292471907992659431657842e-01, -4.333953941292471907992659431657842e-01,
5.627571346686046833390000992726941e-01, -5.627571346686046833390000992726941e-01,
6.794095682990244062343273651148736e-01, -6.794095682990244062343273651148736e-01,
7.808177265864168970637175783450424e-01, -7.808177265864168970637175783450424e-01,
8.650633666889845107320966884234930e-01, -8.650633666889845107320966884234930e-01,
9.301574913557082260012071800595083e-01, -9.301574913557082260012071800595083e-01,
9.739065285171717200779640120844521e-01, -9.739065285171717200779640120844521e-01,
9.956571630258080807355272806890028e-01, -9.956571630258080807355272806890028e-01)
gk.w<-c(1.494455540029169056649364683898212e-01,
rep(c(1.477391049013384913748415159720680e-01,1.427759385770600807970942731387171e-01,
1.347092173114733259280540017717068e-01, 1.234919762620658510779581098310742e-01,
1.093871588022976418992105903258050e-01, 9.312545458369760553506546508336634e-02,
7.503967481091995276704314091619001e-02, 5.475589657435199603138130024458018e-02,
3.255816230796472747881897245938976e-02, 1.169463886737187427806439606219205e-02),each=2))
}
return(list(gk.n=gk.n,gk.w=gk.w))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.