
from __future__ import annotations

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

# initial triangle of Koch snowflake
lowercase__	:Tuple										=					numpy.array([0, 0])
lowercase__	:Tuple										=					numpy.array([0.5, 0.8_660_254])
lowercase__	:Optional[Any]										=					numpy.array([1, 0])
lowercase__	:str										=					[VECTOR_1, VECTOR_2, VECTOR_3, VECTOR_1]



def  UpperCamelCase					(							lowerCAmelCase__				,    lowerCAmelCase__	):
					'''simple docstring'''
					lowercase					=		initial_vectors
					for _ in range(lowerCAmelCase__	):
										lowercase					=		iteration_step(lowerCAmelCase__	)
					return vectors



def  UpperCamelCase					(							lowerCAmelCase__	):
					'''simple docstring'''
					lowercase					=		[]
					for i, start_vector in enumerate(vectors[:-1]	):
										lowercase					=		vectors[i + 1]
										new_vectors.append(lowerCAmelCase__	)
										lowercase					=		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  UpperCamelCase					(							lowerCAmelCase__				,    lowerCAmelCase__	):
					'''simple docstring'''
					lowercase					=		numpy.radians(lowerCAmelCase__	)
					lowercase			,		lowercase					=		numpy.cos(lowerCAmelCase__	), numpy.sin(lowerCAmelCase__	)
					lowercase					=		numpy.array(((c, -s), (s, c))	)
					return numpy.dot(lowerCAmelCase__				,    lowerCAmelCase__	)



def  UpperCamelCase					(							lowerCAmelCase__	):
					'''simple docstring'''
					lowercase					=		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()
					lowercase			,		lowercase					=		zip(*lowerCAmelCase__	)
					plt.plot(lowerCAmelCase__				,    lowerCAmelCase__	)
					plt.show()


if __name__ == "__main__":
							import doctest

							doctest.testmod()

							lowercase__	:Tuple										=					iterate(INITIAL_VECTORS, 5)
							plot(processed_vectors)





def  UpperCamelCase					(							lowerCAmelCase__				,    lowerCAmelCase__	):
					'''simple docstring'''
					return int((input_a, input_a).count(0	) == 0	)



def  UpperCamelCase					(							):
					'''simple docstring'''
					assert and_gate(0				,    0	) == 0
					assert and_gate(0				,    1	) == 0
					assert and_gate(1				,    0	) == 0
					assert and_gate(1				,    1	) == 1


if __name__ == "__main__":
							test_and_gate()
							print(and_gate(1, 0))
							print(and_gate(0, 0))
							print(and_gate(0, 1))
							print(and_gate(1, 1))




