Skip to content

Commit

Permalink
rope: add plot of for theta_2 values
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Bevenius <[email protected]>
  • Loading branch information
danbev committed Jul 22, 2024
1 parent 0b7abc1 commit c97bc5e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions fundamentals/python/src/rope-rotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,29 @@
plt.legend()
plt.show()

import numpy as np
import matplotlib.pyplot as plt

# Theta value for dimension index 2
theta_2 = 0.964662

# Positions in the sequence
positions = np.arange(0, 11, 1) # From position 0 to 10

# Calculate cosine and sine values for each position
cos_values = np.cos(theta_2 * positions)
sin_values = np.sin(theta_2 * positions)

# Create the plot
plt.figure(figsize=(10, 6))
plt.plot(positions, cos_values, label='cos(theta_2 * p)', marker='o')
plt.plot(positions, sin_values, label='sin(theta_2 * p)', marker='x')
plt.xlabel('Position (p)')
plt.ylabel('Value')
plt.title('Cosine and Sine Values for Theta_2 Over Positions')
plt.legend()
plt.grid(True)
plt.show()



0 comments on commit c97bc5e

Please sign in to comment.