Skip to content

drviruses/rotation-of-square-matrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

rotation-of-square-matrix

Rotation of Square Matrix

Condition Required:
  Square Matrix
  Angle must be multiple of 90
  Clockwise Rotation


You will be asked wether to roatate the Matrix in clockwise or in Anti-Clockwise direction

This code does not do alter the Matrix , it just prints the pattern.
 For eg: 
1 2 3                             7 4 1                           9 8 7
4 5 6   ---90 degree clockwise--> 8 5 2 ---90 degree clockwise--> 6 5 4 -- so on---->
7 8 9                             9 6 3                           3 2 1

For Anticlockwise rotation we can see the pattern(each rotation is of 90 degree as roation must be multiple of 90)
        1 Anticlocwise ---> 3 clockwise roation
        2 Anticlocwise ---> 2 clockwise roation
        3 Anticlocwise ---> 1 clockwise roation
        4 Anticlocwise ---> 0 clockwise roation

About

Rotation of square matrix

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages