import numpy as np
# Create a random 10x2 matrix of Cartesian coordinates
cartesian = np.random.rand(10, 2)
# Convert to polar coordinates
r = np.sqrt(cartesian[:, 0]**2 + cartesian[:, 1]**2)
theta = np.arctan2(cartesian[:, 1], cartesian[:, 0])
# Create a new 10x2 matrix of polar coordinates
polar = np.column_stack((r, theta))
print("Cartesian coordinates:")
print(cartesian)
print("Polar coordinates:")
print(polar)