正方形の回転は、回転行列を使って行うことができる、
[cosθ, -sinθ
sinθ, cosθ］
点の新しいx,y座標を求めるには、元のx,y座標を含むベクトルと回転行列に与えられたθを掛ける。
次のコードは、原点を中心とする正方形の座標を、10回転するまで計算する。
```python
# Import necessary libraries
import math
import time

# Define a POINT class
class POINT:
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def __str__(self):
        return "x: " + str(self.x) + ", y: " + str(self.y)

# Rotation operation
def rotation(cos_theta, sin_theta,point):

    newPoint = POINT( # Create new point with new coordinates
        point.x * cos_theta - point.y * sin_theta,
        point.x * sin_theta + point.y * cos_theta
    )
    return newPoint

def main():

    theta = 0.0
    rad_per_second = 0.1 # Radians per second
    tick_rate =  60 # How may times per second to update the coordinates
    tick_interval = 1.0 / tick_rate

    number_of_turns = 10 # turn
    number_of_ticks = 2.0 * math.pi * number_of_turns * (rad_per_second * tick_rate)
    number_of_ticks = int(number_of_ticks)

    square = [ # Define the original coordinates of the square
        POINT(1, 1),
        POINT(-1, 1),
        POINT(1, -1),
        POINT(-1, -1)
    ]

    current_tick = 0
    while (current_tick <= number_of_ticks):
        
        new_square = [None] * len(square)
        i = 0
        for point in square:
            new_square[i] = rotation(math.cos(theta), math.sin(theta), point)
            i += 1
        
        for point in new_square:
            print("x: {:.2f}, y: {:.2f}".format(point.x, point.y))
        
        current_tick += 1
        theta += rad_per_second
        print("\n")

        time.sleep(tick_interval)

main()    
```
このコードは何も表示しませんが、pygameやmatplotlibのようなpythonのビジュアルライブラリで実装できます。このコードはプログラマが調整できる初歩的なティックタイミングの方法を使用しています。
このプログラムは、正方形に含まれる4点の座標を回転させながら標準出力(stdout)に出力します。
Rotating a square can be done using a rotation matrix,
[ cosθ, -sinθ  
sinθ,  cosθ ]
To find the  new x, y coordinates of a point, you would multiply the vector containing the original x, y coordinates to the rotation matrix with a given θ.
The following code computes the coordinates of a square centered at its origin, until it has done 10 turns.
```python
# Import necessary libraries
import math
import time

# Define a POINT class
class POINT:
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def __str__(self):
        return "x: " + str(self.x) + ", y: " + str(self.y)

# Rotation operation
def rotation(cos_theta, sin_theta,point):

    newPoint = POINT( # Create new point with new coordinates
        point.x * cos_theta - point.y * sin_theta,
        point.x * sin_theta + point.y * cos_theta
    )
    return newPoint

def main():

    theta = 0.0
    rad_per_second = 0.1 # Radians per second
    tick_rate =  60 # How may times per second to update the coordinates
    tick_interval = 1.0 / tick_rate

    number_of_turns = 10 # turn
    number_of_ticks = 2.0 * math.pi * number_of_turns * (rad_per_second * tick_rate)
    number_of_ticks = int(number_of_ticks)

    square = [ # Define the original coordinates of the square
        POINT(1, 1),
        POINT(-1, 1),
        POINT(1, -1),
        POINT(-1, -1)
    ]

    current_tick = 0
    while (current_tick <= number_of_ticks):
        
        new_square = [None] * len(square)
        i = 0
        for point in square:
            new_square[i] = rotation(math.cos(theta), math.sin(theta), point)
            i += 1
        
        for point in new_square:
            print("x: {:.2f}, y: {:.2f}".format(point.x, point.y))
        
        current_tick += 1
        theta += rad_per_second
        print("\n")

        time.sleep(tick_interval)

main()    
``` 
This code doesn't display anything, but it could be implemented with visual python's visual libraries such as pygame, or even matplotlib. This code uses a rudimentary tick timing method that can be adjusted by the programmer.
This program outputs to the standard output (stdout) the coordinates of the 4 points contained within the square as they are rotated.