Tell me Pi is irrational without actually telling me Pi is irrational

Sdílet
Vložit
  • čas přidán 23. 10. 2023
  • Here is the original 10 minute slow version of my viral Pi reel on Instagram! Also provided the python code on how to use the equation to draw the graph! The code is not for the animation, but just a steady graph.
    Hope this might answer your questions!
    Here is the link to the Pi reel : reelCyrFBp...
    Detailed explanation of Pi post by angzt from reddit :
    / gnprzizzgh
    Python code :
    import numpy as np
    import matplotlib.pyplot as plt
    Create an array of theta values in degrees (e.g., from 0 to 113*360 degrees)
    theta_degrees = np.linspace(0, 113*360, 10000)
    Convert degrees to radians
    theta_radians = np.deg2rad(theta_degrees)
    Calculate z(theta) using the formula , 1j is imaginary number
    z = np.exp(theta_radians * 1j) + np.exp(np.pi * theta_radians * 1j)
    Separate the real and imaginary parts of z
    x = np.real(z)
    y = np.imag(z)
    Create a plot with specific settings
    plt.figure(figsize=(10, 10)) # Set a square figure 10x10 inches
    plt.plot(x, y, color='white', linewidth=0.5) # Set line color to white and line width to 0.5
    plt.gca().set_facecolor('black') # Set background color to black
    plt.gca().set_aspect('equal') # Equal aspect ratio
    plt.grid(False) # Turn off the grids
    plt.xlim(-2.5, 2.5) # X-axis limit
    plt.ylim(-2.5, 2.5) # Y-axis limit
    plt.show() # Display the plot
  • Krátké a kreslené filmy

Komentáře • 46

  • @amazingfireboy1848
    @amazingfireboy1848 Před 7 měsíci +52

    When I clicked I was hoping to see more than I did in the Short, not just a slowed-down version. Why not just keep it running quickly for an hour and check out the almost perfect circle?

    • @niellity
      @niellity Před 7 měsíci +9

      Same, i got so mesmerized I started looking to see if there was an extended clip 💀

    • @fascinating.fractals
      @fascinating.fractals  Před 7 měsíci +58

      It’s about FPS ( frames per second) and collecting each point at each frame, I had to render 40000 frames ( for 40000 points ) for just one minute video. Imagine let alone 5 minutes ( 200K frames ) . I don’t have enough RAM nor my laptop is capable of performing such a long calculation.

    • @amazingfireboy1848
      @amazingfireboy1848 Před 7 měsíci +8

      @@fascinating.fractals I see, thanks.

    • @longlivelinux90
      @longlivelinux90 Před 7 měsíci +4

      If you want hours of a perfect circle, spotify got you

    • @needlesslylongnametospell
      @needlesslylongnametospell Před 7 měsíci +1

      @amazingfireboy1848 well, why don't you run it yourself then with all the parameters you want? Change speed and whatsoever. Read documentation of matplolith, it will be there

  • @_prajwalgajmer
    @_prajwalgajmer Před 6 měsíci +1

    Thank you so much for the code ☺️☺️

  • @nirojnaik5260
    @nirojnaik5260 Před 7 měsíci +1

    Underrated you tube channel 😅

  • @TeamWerbar40
    @TeamWerbar40 Před 7 měsíci +5

    hi
    so cool, can you paste de code for the motion ?
    Thank you !

  • @juanpabloaraujotome5272
    @juanpabloaraujotome5272 Před měsícem

    Simplemente fascinante, gracias por compartirlo, saludos desde Uruguay

  • @vahana690
    @vahana690 Před 4 měsíci +1

    Thanks for the code. I tried to run it, but it just shows a finished plot. How can i make the animation with the two lines?

  • @muhammedsanjid3420
    @muhammedsanjid3420 Před 7 měsíci +1

    Great work

  • @exalian5218
    @exalian5218 Před 7 měsíci

    Should keep this going a ridiculous amount of time

  • @justaconfusedguy3263
    @justaconfusedguy3263 Před 6 měsíci

    can u explain how it shows the ration between the diamter and circumfrence

  • @mr.proudysharma328
    @mr.proudysharma328 Před 7 měsíci +7

    how did u animate the whole process? when u run this code it only returns the ploted graph

    • @fascinating.fractals
      @fascinating.fractals  Před 7 měsíci +9

      Animation is much more complex, especially the camera navigation part. You need to manipulate xlim,ylim value ranges manually for each frame, for zoom and for tracking the point.

    • @DrymarchonShaun
      @DrymarchonShaun Před 7 měsíci

      @@fascinating.fractals do you have an example for the animation code somewhere? Do you use GitHub?

    • @mr.proudysharma328
      @mr.proudysharma328 Před 7 měsíci +1

      @fascinating.fractals I see and do u also animate using matplotlib? Or other software?

  • @op-yf8rf
    @op-yf8rf Před 7 měsíci

    WHERE I CAN WRITE THIS CODE ?

  • @kalidasgaonkar5763
    @kalidasgaonkar5763 Před 5 měsíci

    Can you provide code for animation pls

  • @nirojnaik5260
    @nirojnaik5260 Před 7 měsíci +1

    please
    Make a tutorial with details
    Please please please 🙏🙏🙏🙏

  • @Siva5842
    @Siva5842 Před 6 měsíci

    Please reply how to make the animation

  • @kenhdclapraecommentdao449
    @kenhdclapraecommentdao449 Před 7 měsíci

    Ty

  • @krishnarai1718
    @krishnarai1718 Před 7 měsíci

    Satisfying

  • @pratyushlakkadwala2877
    @pratyushlakkadwala2877 Před 7 měsíci +6

    Can you provide a code for animating this pattern??

    • @true_xander
      @true_xander Před 7 měsíci +3

      Its on screen my man.

    • @allu_bechne_wala_rohit
      @allu_bechne_wala_rohit Před 7 měsíci +10

      @@true_xander It's for the plot not the animation.

    • @JobMiltaHai
      @JobMiltaHai Před 7 měsíci

      Check description bro

    • @631kw
      @631kw Před 7 měsíci

      I asked ChatGPT to get the code. The first few seconds seem promising:
      import numpy as np
      import matplotlib.pyplot as plt
      from matplotlib.animation import FuncAnimation
      # Create an array of theta values
      theta_degrees = np.linspace(0, 113*360, 10000)
      theta_radians = np.deg2rad(theta_degrees)
      # Calculate z(theta) using the formula, 1j is imaginary number
      z = np.exp(theta_radians * 1j) + np.exp(np.pi * theta_radians * 1j)
      # Separate the real and imaginary parts of z
      x = np.real(z)
      y = np.imag(z)
      # Create a figure and an axes
      fig, ax = plt.subplots(figsize=(10, 10))
      # Set up the plot
      line, = ax.plot([], [], color='white', linewidth=0.5)
      ax.set_facecolor('black')
      ax.set_aspect('equal')
      ax.grid(False)
      ax.set_xlim(-2.5, 2.5)
      ax.set_ylim(-2.5, 2.5)
      # Initialization function: plot the background of each frame
      def init():
      line.set_data([], [])
      return line,
      # Animation function: this is called sequentially
      def animate(i):
      line.set_data(x[:i], y[:i])
      return line,
      # Call the animator
      ani = FuncAnimation(fig, animate, init_func=init, frames=len(theta_radians), interval=20, blit=True)
      # To save the animation, use the following line
      # ani.save('pi_circle_animation.mp4', fps=30, extra_args=['-vcodec', 'libx264'])
      plt.show()

  • @munjalrajyaguru
    @munjalrajyaguru Před 7 měsíci

    bro it's showing no module named "numpy" error

    • @mr.proudysharma328
      @mr.proudysharma328 Před 7 měsíci +1

      run "pip install numpy" in terminal

    • @Fermion.
      @Fermion. Před 7 měsíci +7

      If you don't understand that error, you should start with the very basics, before trying to mess around with plotting graphs.

  • @igorkksks2272
    @igorkksks2272 Před 7 měsíci

    Tutorial

  • @xtraszone
    @xtraszone Před 6 měsíci

    The program is there just to sell you

  • @user-vx8lk2rs4k
    @user-vx8lk2rs4k Před 7 měsíci +1

    Stolen content

    • @lukkagge
      @lukkagge Před 5 měsíci

      Bro, this guy made the original YOU DUMB FU- i mean, stfu