add R function of greatcircle