Not sure understood question correct.
1.suppsoe two points are their.
2.calculate relative vector between point.
3.calculate angle between relative vector and the axis about which want to rotate.
4.the use rotate api.(give angle which is calculated)