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$.






This is more of a comment than an answer, but since it will take some space, writing it here.
I think you are asking about "directed distance" or a "vector" from the point $(2,2)$ to each of the other points. Depending on what your coordinate axes are, the vectors each undergo a rotation.
I am not sure why, in the canonical form (your first example) you've defined $x$ to be up and $y$ to the left. That's okay, as long as you are consistent. But then, why is $d_{1,1}=-(d_y,d_x)$? Are you defining the directed distance from $(1,1)$ to $(2,2)$. Seems that $(2,2)$ is the origin of your coordinate system. We usually define vectors or directed distances from the origin to another point. In any case, once you settle on a meaningful coordinate system, any rotation in the axes can be coded (calculated) by multiplying each vector by a rotation matrix.
$$R=\begin{pmatrix} \phantom{-} \cos \varphi& \sin \varphi\\ -\sin\varphi & \cos \varphi \end{pmatrix},$$ being careful to define $\phi$ appropriately as the angle of rotation from one of the coordinate axes. Depending on whether you are defining the rotation of the axes, or the rotation of the vector (and how you define all of the above), that minus sign might be better placed with the other $\sin \phi$. A simple way to check if you have it correct is to compute the resulting vectors for some special case, for example $\varphi=30^\circ.$