This commit is contained in:
Fomys 2019-02-26 19:41:10 +01:00
parent b7a4968b91
commit fb2858fb52

View File

@ -1,6 +1,5 @@
import cmath import cmath
from math import atan, cos, sin, pi from math import atan, cos, sin, pi
from typing import List, Tuple
from PIL import Image, ImageDraw from PIL import Image, ImageDraw
@ -17,7 +16,7 @@ A lib to draw fractals on pillow image
class State: class State:
"""State of Lsystem""" """State of Lsystem"""
width: int width: int
color: Tuple[int, int, int] color: tuple[int, int, int]
angle: int angle: int
y: int y: int
x: int x: int
@ -45,7 +44,7 @@ class State:
class Lsystem(ImageDraw.ImageDraw): class Lsystem(ImageDraw.ImageDraw):
"""Draw a L system""" """Draw a L system"""
state: State state: State
states: List[State] states: list[State]
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
"""Initialisation """Initialisation
@ -199,7 +198,7 @@ class Figures(ImageDraw.ImageDraw):
:param point: Point to convert :param point: Point to convert
:type point: complex :type point: complex
:return: Tuple representation of point :return: tuple representation of point
:rtype: tuple(float, float)""" :rtype: tuple(float, float)"""
return point.real, point.imag return point.real, point.imag