





'''simple docstring'''


from __future__ import annotations

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

# initial triangle of Koch snowflake
_SCREAMING_SNAKE_CASE     :   Dict	 =							numpy.array([0, 0])
_SCREAMING_SNAKE_CASE     :   Optional[int]	 =							numpy.array([0.5, 0.866_0254])
_SCREAMING_SNAKE_CASE     :   Optional[int]	 =							numpy.array([1, 0])
_SCREAMING_SNAKE_CASE     :   Optional[Any]	 =							[VECTOR_1, VECTOR_2, VECTOR_3, VECTOR_1]


def 	__a(SCREAMING_SNAKE_CASE_  :					Optional[int]		,       SCREAMING_SNAKE_CASE_  :					int    ):



    '''simple docstring'''





    _lowerCAmelCase				=      initial_vectors
    for _ in range(lowerCamelCase__    ):
        _lowerCAmelCase				=      iteration_step(lowerCamelCase__    )
    return vectors


def 	__a(SCREAMING_SNAKE_CASE_  :					Optional[Any]    ):



    '''simple docstring'''





    _lowerCAmelCase				=      []
    for i, start_vector in enumerate(vectors[:-1]    ):
        _lowerCAmelCase				=      vectors[i + 1]
        new_vectors.append(lowerCamelCase__    )
        _lowerCAmelCase				=      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 	__a(SCREAMING_SNAKE_CASE_  :					List[Any]		,       SCREAMING_SNAKE_CASE_  :					str    ):



    '''simple docstring'''





    _lowerCAmelCase				=      numpy.radians(lowerCamelCase__    )
    _lowerCAmelCase			,			_lowerCAmelCase				=      numpy.cos(lowerCamelCase__    ), numpy.sin(lowerCamelCase__    )
    _lowerCAmelCase				=      numpy.array(((c, -s), (s, c))    )
    return numpy.dot(lowerCamelCase__		,       lowerCamelCase__    )


def 	__a(SCREAMING_SNAKE_CASE_  :					Optional[Any]    ):



    '''simple docstring'''





    _lowerCAmelCase				=      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()
    _lowerCAmelCase			,			_lowerCAmelCase				=      zip(*lowerCamelCase__    )
    plt.plot(lowerCamelCase__		,       lowerCamelCase__    )
    plt.show()


if __name__ == "__main__":
       import doctest

       doctest.testmod()

       _SCREAMING_SNAKE_CASE     :   List[str]	 =							iterate(INITIAL_VECTORS, 5)
       plot(processed_vectors)









'''simple docstring'''


def 	__a(SCREAMING_SNAKE_CASE_  :					str		,       SCREAMING_SNAKE_CASE_  :					bool = False    ):



    '''simple docstring'''





    if not isinstance(SCREAMING_SNAKE_CASE_		,       SCREAMING_SNAKE_CASE_    ):
        _lowerCAmelCase				=      F'''Expected string as input, found {type(SCREAMING_SNAKE_CASE_    )}'''
        raise ValueError(SCREAMING_SNAKE_CASE_    )
    if not isinstance(SCREAMING_SNAKE_CASE_		,       SCREAMING_SNAKE_CASE_    ):
        _lowerCAmelCase				=      F'''Expected boolean as use_pascal parameter, found {type(SCREAMING_SNAKE_CASE_    )}'''
        raise ValueError(SCREAMING_SNAKE_CASE_    )

    _lowerCAmelCase				=      input_str.split("_"    )

    _lowerCAmelCase				=      0 if use_pascal else 1

    _lowerCAmelCase				=      words[start_index:]

    _lowerCAmelCase				=      [word[0].upper() + word[1:] for word in words_to_capitalize]

    _lowerCAmelCase				=      "" if use_pascal else words[0]

    return "".join([initial_word, *capitalized_words]    )


if __name__ == "__main__":
       from doctest import testmod

       testmod()


