Imagine you have two points in 2d space and you need to rotate one of these points by X degrees with the other point acting as a center.
float distX = Math.a
Translate "1" to 0,0
Rotate
x = sin(angle) * r; y = cos(angle) * r;
Translate it back