I need to make the navigation and guidance of a vehicle (a quadcopter) in a platform. This platform can be seen like this:
where the blue dots are the center of each square, and the $x$ distances are all the same, and the $y$ distances are all the same.
I need the distance between each blue dot to the center (the blue dot of the $(2;2)$), but that distance depends on the $yaw$ angle. For example, if $yaw=0^\circ$, the situation is like this:
and the distances are:
$$d_{1;1} = (-d_x; -d_y)$$ $$d_{1;2} = (-d_x; 0)$$ $$d_{1;3} = (-d_x; d_y)$$
$$d_{2;1} = (0; -d_y)$$ $$d_{2;2} = (0; 0)$$ $$d_{2;3} = (0; d_y)$$
$$d_{3;1} = (d_x; -d_y)$$ $$d_{3;2} = (d_x; 0)$$ $$d_{3;3} = (d_x; d_y)$$
If the situation is with $yaw=180^\circ$:
the distances are the same but with the opposite sign, i.e,
$$d_{1;1} = (d_x; d_y)$$ $$d_{1;2} = (d_x; 0)$$ $$d_{1;3} = (d_x; -d_y)$$
$$d_{2;1} = (0; d_y)$$ $$d_{2;2} = (0; 0)$$ $$d_{2;3} = (0; -d_y)$$
$$d_{3;1} = (-d_x; d_y)$$ $$d_{3;2} = (-d_x; 0)$$ $$d_{3;3} = (-d_x; -d_y)$$
If $yaw=90^\circ$, the situation is like this:
and the distances (see the difference between $d_x$ and $d_y$) would be:
$$d_{1;1} = (-d_y; d_x)$$ $$d_{1;2} = (-d_y; 0)$$ $$d_{1;3} = (-d_y; d_x)$$
$$d_{2;1} = (0; -d_x)$$ $$d_{2;2} = (0; 0)$$ $$d_{2;3} = (0; d_x)$$
$$d_{3;1} = (d_y; -d_x)$$ $$d_{3;2} = (d_y; 0)$$ $$d_{3;3} = (d_y; d_x)$$
If $yaw = -90^\circ$:
the distances would be:
$$d_{1;1} = (d_y; d_x)$$ $$d_{1;2} = (d_y; 0)$$ $$d_{1;3} = (d_y; -d_x)$$
$$d_{2;1} = (0; d_x)$$ $$d_{2;2} = (0; 0)$$ $$d_{2;3} = (0; -d_x)$$
$$d_{3;1} = (-d_y; d_x)$$ $$d_{3;2} = (-d_y; 0)$$ $$d_{3;3} = (-d_y; -d_x)$$
I need to write a matrix that uses the information of the $yaw$ angle and returns the distances from each angle (not just 0, 90, -90 and 180, but also 1, 2, 3, ...)
I tried to write it but I couldn't find the solution.
Thank you very much. I really need this help
Edit: please note that the coordinate frame moves with the quadcopter, like in this image:
Edit 2: for example, if $yaw=45^\circ$, then the distance from $(3;3)$ to $(2;2)$ is $\sqrt{d_x^2+d_y^2}$ in $x$ and $0$ in $y$.