powered by
Function to rotate points by one or more angles
f_rotacao(x, y, rotacao)
Returns a dataframe with the original points plus the respective rotations of these points.
is a vector length n with coordinate x of point
is a vector length n with coordinate y of point
is a vector of length k with angles in radians to rotate the point (x,y)
If x and y dimension is n and rotation dimension is k, then function f_rotacao will return a dataframe with two columns and (n+1)k rows
x=c(1,1) y=c(0,1) rotacao=c(pi/3, pi/2, pi) f_rotacao(x,y,rotacao)
Run the code above in your browser using DataLab