2d Coordinate rotation in clockwise direction

How do I rotate a 2d coordinate about the origin in a clockwise direction, I have data points for the origin as [start_x = 24.000;
,start_y = 16.000] and target lorcation [target_x = 27.000,target_y = 16.000], but I want to rotate my target at an angle of 45 degrees clockwise about the origin and I am wondering if there is a way to get a function for the new target coodinates.

 Respuesta aceptada

KSSV
KSSV el 18 de En. de 2019
th = pi/4 ;
R = [cos(th) -sin(th) ;sin(th) cos(th)] ;
Multiply your points with the above R. Read about rotation matrix: https://en.wikipedia.org/wiki/Rotation_matrix

Más respuestas (1)

Reuben Addison
Reuben Addison el 18 de En. de 2019

0 votos

I think this function rotates counter clockwise , any idea how I could make it clockwise

Categorías

Más información sobre Animation en Centro de ayuda y File Exchange.

Productos

Versión

R2018a

Etiquetas

Preguntada:

el 18 de En. de 2019

Comentada:

el 18 de En. de 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by