translate trig kernel functions to julia