Buffon's needle simulation in python

后端 未结 6 1487
臣服心动
臣服心动 2021-01-27 18:47
import numpy as np
import matplotlib.pylab as plt

class Buffon_needle_problem:

    def __init__(self,x,y,n,m):
        self.x = x #width of the needle
        self.y =         


        
6条回答
  •  -上瘾入骨i
    2021-01-27 19:08

    Buffon's needle work accurately only when the distance between the two lines is double the length of needle. Make sure to cross check it.

    I have seen many baffon's online simulation which are doing this mistake. They just take the distance between two adjacent lines to be equal to the needle's length. That's their main logical errors.

提交回复
热议问题