# How to rotate points on 2D coordinate systems

618 views (last 30 days)
Rightia Rollmann on 5 Feb 2017
Commented: Hassan Bosha on 4 Apr 2020
I have some points on a 2D Cartesian coordinate system. I want to rotate all these points 90 degrees counterclockwise. What is the best solution? (When I work with 3D coordinates, I use “view” to change the view direction, but apparently, it doesn’t work with 2D coordinates)

John Chilleri on 6 Feb 2017
Hello,
You can rotate your points with a rotation matrix:
Here's a simple implementation,
% Create rotation matrix
theta = 90; % to rotate 90 counterclockwise
R = [cosd(theta) -sind(theta); sind(theta) cosd(theta)];
point = [3 5]'; % arbitrarily selected
rotpoint = R*point;
The rotpoint is the 90 degree counterclockwise rotated version of your original point.
Hope this helps!
Hassan Bosha on 4 Apr 2020
How can i plot it ?
using trplot()

Asma Rahmani on 16 Jul 2018
heyy, i want to divise an image with matrix rotation to 6 segments (theta=60degrees),the point is to incrimente a new segment with the last segment.can u help me please

### Categories

Find more on Feature Detection and Extraction in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by