I want to find the blue point
I know the red point b
and the angle between 2 radii
CodePudding user response:
We know that the red point has coordinates (B.x, B.y)
. We know the origin point (A.x, A.y)
. We know the angle between the points theta
. We want to find (C.x, C.y)
. I will be assuming 2d geometry, as this is what your reference shows.
Using a rotation matrix, we can subtract B
by A
to place A
at the origin, then applying the matrix with the angle given.
Thus, given
B_new = (B.x - A.x, B.y - A.y)
,
C = (B_new.x * cos(theta) - B_new.y * sin(theta), B_new.x * sin(theta) B_new.y * cos(theta)) (A.x, A.y)