Howdy @runner, you should definitely check out the post over here => http://stackoverflow.com/a/3226672/1076057. Also, while this is feasibly possible in ReQL, it might be a bit slow since you'd want to call `r.js("arbitrary js code")` for some of the Math functions. Here are some examples here => https://gist.github.com/dalanmiller/c71f7dea1533e9f6690e
– dalanmillerJan 26 '16 at 19:13