Nexus File Manager
v2.0
🏠
Dashboard
⚡
System
🌐
›
opt
›
alt
›
python38
›
lib64
›
python3.8
›
turtledemo
›
__pycache__
Quick:
⬆️ Parent
🌐 Root
🏠 Home
🌍 WWW
📁 Temp
⚙️ Etc
📤 Upload
📁 Create
⚡ WordPress Admin
🔄 Refresh
✏️ fractalcurves.cpython-38.pyc
← Back
U i�f� � @ sT d Z ddlT ddlmZmZ G dd� de�Zdd� Ze dkrPe� Z ee � e� d S ) a& turtle-example-suite: tdemo_fractalCurves.py This program draws two fractal-curve-designs: (1) A hilbert curve (in a box) (2) A combination of Koch-curves. The CurvesTurtle class and the fractal-curve- methods are taken from the PythonCard example scripts for turtle-graphics. � )�*)�sleep�perf_counterc @ s$ e Zd Zdd� Zdd� Zdd� ZdS )�CurvesTurtlec C s� |dkrd S | � |d � | �||d | � | �|� | �|d � | �||d |� | �|� | �||d |� | �|d � | �|� | �||d | � | � |d � d S )Nr �Z � )�left�hilbertZforward�right)�self�size�levelZparity� r �=/opt/alt/python38/lib64/python3.8/turtledemo/fractalcurves.pyr s zCurvesTurtle.hilbertc C s� dd l }d| |�|j| � }| �� | �|� | �� | �dd|d | � t|�D ] }| �|||� | �d| � q\| � dd|d | � | �� | � |� | �� d S )Nr � � r ih )�mathZsinZpi�pu�fd�pd�rt�range�fractal�ltZbk)r �nZradZlev�dirr Zedge�ir r r � fractalgon/ s zCurvesTurtle.fractalgonc C s� |dk r| � |� d S | �|d |d |� | �d| � | �|d |d |� | �d| � | �|d |d |� | �d| � | �|d |d |� d S )Nr � �<