Calculate point's coordinates relative to rotation in 3D-space

782 Views Asked by At

I have a point "A" in 3D-space, let's say in coordinates (2, 3, -1). Then there's a point "B" which position is A + (-1, 2, -1), so now it's (2 + (-1), 3 + 2, -1 + (-1)) = (1, 5, -2). How do I calculate the position of B when A "rotates"? In 2D-plane this would be easy:

2d-rotation

How do I do this in 3D-space? Any help would be appropriated.