Skip to main content

Rotate any matrix of any type, either clockwise or anti-clockwise instantly.

Project description

ROTATE MATRIX:

Install:

Install it using:

         pip install rotate-matrix

Rotate any matrix/multi-dimentional array of any type, either clockwise or anti-clockwise instantly.

Contains two functions:

1) clockwise(): Takes l as parameter which is of type list, and pases the clockwised rotated version list l.

        import rotate_matrix
        l = [[1,2,4,3],[7,8,5,6],[8,6,5,4]]
        print(rotate_matrix.clockwise(l))

Output:

        [(3, 6, 4), (4, 5, 5), (2, 8, 6), (1, 7, 8)]

2) anti-clockwise(): Takes l as parameter which is of type list, and passes the anti-clockwise rotated version of list l.

         import rotate_matrix
        l = [[1,2,4,3],[7,8,5,6],[8,6,5,4]]
        print(rotate_matrix.anti_clockwise(l))

Output:

       [(8, 7, 1), (6, 8, 2), (5, 5, 4), (4, 6, 3)]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rotate_matrix-0.0.7.tar.gz (3.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page