fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. }
  14. }
Success #stdin #stdout 0.09s 54656KB
stdin
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import numpy as np

# 図の設定
fig, ax = plt.subplots()
ax.set_xlim(-2, 2)
ax.set_ylim(-2, 2)
ax.set_aspect('equal')  # 円く見せるために
line, = ax.plot([], [], 'o-', lw=2, color='blue')  # 青い線で円描く

def init():
    line.set_data([], [])
    return line,

def animate(i):
    theta = np.linspace(0, 2*np.pi, 100)  # 円の点100個
    x = np.cos(theta + i/10)  # iで回転させる
    y = np.sin(theta + i/10)
    line.set_data(x, y)
    return line,

# アニメーション作成(360フレームで一周、50ms間隔)
ani = animation.FuncAnimation(fig, animate, init_func=init, frames=360, interval=50, blit=True)
plt.show()  # これで表示!
stdout
Standard output is empty