changed from cosines to cubics for point drawing