How to rotate it like a cricket bat

I want to rotate in an arc shap with a given set of from x,y,z values to x,y,z values,

You can look into the screenshot, bat initial rotation is -6 or -8 on the x axis, and bat then reached around -35 on x axis and then it move forward and it reached +40 in x axis, how this can be done programmatically.
Basically we will save all the matrices data from sensor and then load it from database and then model will change accordingly.

Right now can choose some static data to start and later will load it from remote.
How to do that?