



'''simple docstring'''
from __future__ import annotations

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

# initial triangle of Koch snowflake
snake_case_ :	List[Any]         =  numpy.array([0, 0])
snake_case_ :	Optional[Any]         =  numpy.array([0.5, 0.8_66_02_54])
snake_case_ :	int         =  numpy.array([1, 0])
snake_case_ :	Optional[int]         =  [VECTOR_1, VECTOR_2, VECTOR_3, VECTOR_1]






def A__    (     UpperCAmelCase_  ,  UpperCAmelCase_							):
						_UpperCamelCase					:		Optional[Any] 				=   initial_vectors
						for _ in range(UpperCAmelCase_							):
												_UpperCamelCase					:		Any 				=   iteration_step(UpperCAmelCase_							)
						return vectors






def A__    (     UpperCAmelCase_							):
						_UpperCamelCase					:		int 				=   []
						for i, start_vector in enumerate(vectors[:-1]							):
												_UpperCamelCase					:		Union[str, Any] 				=   vectors[i + 1]
												new_vectors.append(UpperCAmelCase_							)
												_UpperCamelCase					:		Optional[Any] 				=   end_vector - start_vector
												new_vectors.append(start_vector + difference_vector / 3							)
												new_vectors.append(
												    start_vector + difference_vector / 3 + rotate(difference_vector / 3  ,  6_0							)							)
												new_vectors.append(start_vector + difference_vector * 2 / 3							)
						new_vectors.append(vectors[-1]							)
						return new_vectors






def A__    (     UpperCAmelCase_  ,  UpperCAmelCase_							):
						_UpperCamelCase					:		Dict 				=   numpy.radians(UpperCAmelCase_							)
						_UpperCamelCase				,			_UpperCamelCase					:		Any 				=   numpy.cos(UpperCAmelCase_							), numpy.sin(UpperCAmelCase_							)
						_UpperCamelCase					:		int 				=   numpy.array(((c, -s), (s, c))							)
						return numpy.dot(UpperCAmelCase_  ,  UpperCAmelCase_							)






def A__    (     UpperCAmelCase_							):
						_UpperCamelCase					:		Any 				=   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()
						_UpperCamelCase				,			_UpperCamelCase					:		Optional[Any] 				=   zip(*UpperCAmelCase_							)
						plt.plot(UpperCAmelCase_  ,  UpperCAmelCase_							)
						plt.show()


if __name__ == "__main__":
					import doctest

					doctest.testmod()

					snake_case_ :	Any         =  iterate(INITIAL_VECTORS, 5)
					plot(processed_vectors)







def 	__UpperCamelCase	(  _lowerCAmelCase		)       ->  list:



    """simple docstring"""






    return [
        txt[:a] + txt[a].upper() + txt[a + 1 :]
        for a in range(len(_lowerCAmelCase		)		)
        if txt[a].isalpha()
    ]


if __name__ == "__main__":
     __import__("""doctest""").testmod()


