If we have a pair of coordinates $(x,y)$, let's say
pt = {1,2}
then we can easily rotate the coordinates, by an angle $\theta$, by using the rotation matrix
R = {{Cos[\[Theta]], -Sin[\[Theta]]}, {Sin[\[Theta]], Cos[\[Theta]]}};
as
pt2 = pt.R;
Now let's assume that we have a collection of points in the form
data = {{1}, {-0.3, 1}, {2, -0.2}, {2}, {-2, 1}, {4,-2}, {3}, {1, 1}, {-0.2, -0.3}}
where the integers 1, 2 and 3 count the subsets of the list data.
My question: how can we rotate the $(x,y)$ coordinates of the list data by and angle, let's say $2\pi/3$ and create a new list, data2 of the form
data2 = {{1}, {rotated x, rotated y}, {rotated x, rotated y}, {2}, {rotated x, rotated y}, {roatetd x, rotated y}, ...}
Any suggestions?
RotationTransform[θ]is Listable. – Silvia Aug 02 '19 at 03:44dataformatted like this? Seems to me like the first step should be to find a better way to represent your data. – Sjoerd Smit Apr 18 '23 at 11:48