Function headingToPoint