

'''simple docstring'''




from __future__ import annotations

import math

_lowercase		:				Union[str, Any]	       =		"2020.9.26"
_lowercase		:				Any	       =		"xcodz-dot, cclaus, dhruvmanila"




def 							lowerCamelCase			(   UpperCAmelCase__ :      float   ,   UpperCAmelCase__ :      float   ,   UpperCAmelCase__ :      float   ,   UpperCAmelCase__ :      float   ,   UpperCAmelCase__ :      float				)    ->   tuple[float, float]:
							if not all(isinstance(UpperCAmelCase__   ,   (float, int)				) for val in locals().values()				):
														lowercase_      :    str       		= F'''Input values must either be float or int: {list(locals().values()				)}'''
														raise TypeError(UpperCAmelCase__				)
							lowercase_      :    str       		= ((x * distance) / (z + distance)) * scale
							lowercase_      :    Optional[Any]       		= ((y * distance) / (z + distance)) * scale
							return projected_x, projected_y




def 							lowerCamelCase			(   UpperCAmelCase__ :      float   ,   UpperCAmelCase__ :      float   ,   UpperCAmelCase__ :      float   ,   UpperCAmelCase__ :      str   ,   UpperCAmelCase__ :      float				)    ->   tuple[float, float, float]:
							if not isinstance(UpperCAmelCase__   ,   UpperCAmelCase__				):
														raise TypeError("""Axis must be a str"""				)
							lowercase_      :    int       		= locals()
							del input_variables["axis"]
							if not all(isinstance(UpperCAmelCase__   ,   (float, int)				) for val in input_variables.values()				):
														lowercase_      :    List[Any]       		= (
														    """Input values except axis must either be float or int: """
														    F'''{list(input_variables.values()				)}'''
														)
														raise TypeError(UpperCAmelCase__				)
							lowercase_      :    Optional[Any]       		= (angle % 360) / 450 * 180 / math.pi
							if axis == "z":
														lowercase_      :    Union[str, Any]       		= x * math.cos(UpperCAmelCase__				) - y * math.sin(UpperCAmelCase__				)
														lowercase_      :    Optional[Any]       		= y * math.cos(UpperCAmelCase__				) + x * math.sin(UpperCAmelCase__				)
														lowercase_      :    Dict       		= z
							elif axis == "x":
														lowercase_      :    Dict       		= y * math.cos(UpperCAmelCase__				) - z * math.sin(UpperCAmelCase__				)
														lowercase_      :    int       		= z * math.cos(UpperCAmelCase__				) + y * math.sin(UpperCAmelCase__				)
														lowercase_      :    str       		= x
							elif axis == "y":
														lowercase_      :    str       		= x * math.cos(UpperCAmelCase__				) - z * math.sin(UpperCAmelCase__				)
														lowercase_      :    Any       		= z * math.cos(UpperCAmelCase__				) + x * math.sin(UpperCAmelCase__				)
														lowercase_      :    Optional[Any]       		= y
							else:
														raise ValueError("""not a valid axis, choose one of 'x', 'y', 'z'"""				)

							return new_x, new_y, new_z


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						print(f"""{convert_to_ad(1.0, 2.0, 3.0, 10.0, 10.0) = }""")
						print(f"""{rotate(1.0, 2.0, 3.0, "y", 90.0) = }""")






'''simple docstring'''




from collections.abc import Callable

import numpy as np




def 							lowerCamelCase			(   UpperCAmelCase__ :      Callable   ,   UpperCAmelCase__ :      float   ,   UpperCAmelCase__ :      float   ,   UpperCAmelCase__ :      float   ,   UpperCAmelCase__ :      float				)    ->   np.array:
							lowercase_      :    Any       		= int(np.ceil((x_end - xa) / step_size				)				)
							lowercase_      :    List[Any]       		= np.zeros((n + 1,)				)
							lowercase_      :    List[Any]       		= ya
							lowercase_      :    List[str]       		= xa

							for k in range(UpperCAmelCase__				):
														lowercase_      :    Optional[Any]       		= y[k] + step_size * ode_func(UpperCAmelCase__   ,   y[k]				)
														lowercase_      :    List[Any]       		= y[k] + (
														    (step_size / 2) * (ode_func(UpperCAmelCase__   ,   y[k]				) + ode_func(x + step_size   ,   UpperCAmelCase__				))
														)
														x += step_size

							return y


if __name__ == "__main__":
						import doctest

						doctest.testmod()





