lundi 28 février 2022

Return minimum distance among random points in a square [0,1]^2 in Python [closed]

There is n points in the sqaure [0,1]^2, t is the number of iterations, and the points will be moving when t changes from 0 to 1,2,3... x is the a maximal move of a point in one of four random directions: (−1,0),(1,0),(0,−1),(0,1).

import numpy as np
import random

def list_min_distance(n, x, t): 
    """ 
    n is number of points.
    x is a maximal move
    t is the number of iterations
    """
    **Return a list of min distances**: For example, when t = 1,2,3...how is the min distance like.

My project is to to examine and plot the diagram. I am stuck here, can anyone help?




Aucun commentaire:

Enregistrer un commentaire