<reponame>TechNeilogy/chaos<filename>sierpinski_config_ext0.py
import numpy as np

from sierpinski_config import SierpinskiConfig


class SierpinskiConfigExt0 (SierpinskiConfig):
        
    def update_batch(
        self,
        frame
    ):
        r = np.random.randint(self.set_point_count)

        set_point = self.set_points[r]

        x = set_point[0]
        y = set_point[1]

        x += np.random.uniform(-0.01, 0.01)
        y += np.random.uniform(-0.01, 0.01)

        x = 0 if x < 0 else (1 if x > 1 else x)
        y = 0 if y < 0 else (1 if y > 1 else y)

        set_point[0] = x
        set_point[1] = y
import numpy as np

from sierpinski_config import SierpinskiConfig


class SierpinskiConfigExt0 (SierpinskiConfig):
        
    def update_batch(
        self,
        frame
    ):
        r = np.random.randint(self.set_point_count)

        set_point = self.set_points[r]

        x = set_point[0]
        y = set_point[1]

        x += np.random.uniform(-0.01, 0.01)
        y += np.random.uniform(-0.01, 0.01)

        x = 0 if x < 0 else (1 if x > 1 else x)
        y = 0 if y < 0 else (1 if y > 1 else y)

        set_point[0] = x
        set_point[1] = y