"""simple docstring"""



from __future__ import annotations

import matplotlib.pyplot as plt  # type: ignore
import numpy

# initial triangle of Koch snowflake
__snake_case             =   numpy.array([0, 0])
__snake_case             =   numpy.array([0.5, 0.8_66_02_54])
__snake_case             =   numpy.array([1, 0])
__snake_case             =   [VECTOR_1, VECTOR_2, VECTOR_3, VECTOR_1]







def   __lowerCAmelCase						(						lowercase  :  list[numpy.ndarray]						,							lowercase  :  int			)     ->						list[numpy.ndarray]:


    """simple docstring"""





    snake_case   :				Union[str, Any]				 =   initial_vectors
    for _ in range(lowercase			):
        snake_case   :				Dict				 =   iteration_step(lowercase			)
    return vectors







def   __lowerCAmelCase						(						lowercase  :  list[numpy.ndarray]			)     ->						list[numpy.ndarray]:


    """simple docstring"""





    snake_case   :				Dict				 =   []
    for i, start_vector in enumerate(vectors[:-1]			):
        snake_case   :				Tuple				 =   vectors[i + 1]
        new_vectors.append(lowercase			)
        snake_case   :				Dict				 =   end_vector - start_vector
        new_vectors.append(start_vector + difference_vector / 3			)
        new_vectors.append(
            start_vector + difference_vector / 3 + rotate(difference_vector / 3						,							60			)			)
        new_vectors.append(start_vector + difference_vector * 2 / 3			)
    new_vectors.append(vectors[-1]			)
    return new_vectors







def   __lowerCAmelCase						(						lowercase  :  numpy.ndarray						,							lowercase  :  float			)     ->						numpy.ndarray:


    """simple docstring"""





    snake_case   :				Tuple				 =   numpy.radians(lowercase			)
    snake_case   :				List[str]				 =   numpy.cos(lowercase			), numpy.sin(lowercase			)
    snake_case   :				Dict				 =   numpy.array(((c, -s), (s, c))			)
    return numpy.dot(lowercase						,							lowercase			)







def   __lowerCAmelCase						(						lowercase  :  list[numpy.ndarray]			)     ->						None:


    """simple docstring"""





    snake_case   :				str				 =   plt.gca()
    axes.set_aspect("equal"			)

    # matplotlib.pyplot.plot takes a list of all x-coordinates and a list of all
    # y-coordinates as inputs, which are constructed from the vector-list using
    # zip()
    snake_case   :				Tuple				 =   zip(*lowercase			)
    plt.plot(lowercase						,							lowercase			)
    plt.show()


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  __snake_case             =   iterate(INITIAL_VECTORS, 5)
  plot(processed_vectors)









"""simple docstring"""



from __future__ import annotations

import numpy as np







def   __lowerCAmelCase						(						lowercase  :  list[float]			)     ->						Any:


    """simple docstring"""





    return np.maximum(0						,							lowercase			)


if __name__ == "__main__":
  print(np.array(relu([-1, 0, 5])))  # --> [0, 0, 5]





