Converting a rotation to motiom

I got the math down but for it I'd need to use cos, sin and pi, is there a way to make these operations inside a datapack?
Continue to help post