Está en la página 1de 5

Demostracion del numero pi por viete:

Implementacion en python:

import matplotlib.pyplot as plt

import numpy as np

n=10

b=2

a=0

m=np.zeros([n,2])

for i in range(0,n):

a=(2+a)**0.5

b=b*(2/a)

m[i,0]=i+1

m[i,1]=b

print(m)

x=m[0:n,0]

y=m[0:n,1]

plt.figure()

plt.plot(x,y)

plt.xlabel("eje x")

plt.ylabel("eje y")

plt.title("aproximacion de pi por viete")

pi por wallis:

También podría gustarte