"""simple docstring"""






from __future__ import annotations

import math

__lowerCAmelCase    :       str					     ="""2020.9.26"""
__lowerCAmelCase    :       Optional[Any]					     ="""xcodz-dot, cclaus, dhruvmanila"""


def 			UpperCAmelCase__       (				lowerCAmelCase__     :List[Any]					,		lowerCAmelCase__     :Any					,		lowerCAmelCase__     :int					,		lowerCAmelCase__     :Any					,		lowerCAmelCase__     :int		) ->    tuple[float, float]:
      '''simple docstring'''


      if not all(isinstance(SCREAMING_SNAKE_CASE_					,		(float, int)		) for val in locals().values()		):
            lowercase														=	f'Input values must either be float or int: {list(locals().values()		)}'
            raise TypeError(SCREAMING_SNAKE_CASE_		)
      lowercase														=	((x * distance) / (z + distance)) * scale
      lowercase														=	((y * distance) / (z + distance)) * scale
      return projected_x, projected_y


def 			UpperCAmelCase__       (				lowerCAmelCase__     :List[str]					,		lowerCAmelCase__     :Optional[int]					,		lowerCAmelCase__     :Optional[int]					,		lowerCAmelCase__     :Dict					,		lowerCAmelCase__     :List[Any]		) ->    tuple[float, float, float]:
      '''simple docstring'''


      if not isinstance(SCREAMING_SNAKE_CASE_					,		SCREAMING_SNAKE_CASE_		):
            raise TypeError("""Axis must be a str"""		)
      lowercase														=	locals()
      del input_variables["axis"]
      if not all(isinstance(SCREAMING_SNAKE_CASE_					,		(float, int)		) for val in input_variables.values()		):
            lowercase														=	(
                'Input values except axis must either be float or int: '
                f'{list(input_variables.values()		)}'
            )
            raise TypeError(SCREAMING_SNAKE_CASE_		)
      lowercase														=	(angle % 3_6_0) / 4_5_0 * 1_8_0 / math.pi
      if axis == "z":
            lowercase														=	x * math.cos(SCREAMING_SNAKE_CASE_		) - y * math.sin(SCREAMING_SNAKE_CASE_		)
            lowercase														=	y * math.cos(SCREAMING_SNAKE_CASE_		) + x * math.sin(SCREAMING_SNAKE_CASE_		)
            lowercase														=	z
      elif axis == "x":
            lowercase														=	y * math.cos(SCREAMING_SNAKE_CASE_		) - z * math.sin(SCREAMING_SNAKE_CASE_		)
            lowercase														=	z * math.cos(SCREAMING_SNAKE_CASE_		) + y * math.sin(SCREAMING_SNAKE_CASE_		)
            lowercase														=	x
      elif axis == "y":
            lowercase														=	x * math.cos(SCREAMING_SNAKE_CASE_		) - z * math.sin(SCREAMING_SNAKE_CASE_		)
            lowercase														=	z * math.cos(SCREAMING_SNAKE_CASE_		) + x * math.sin(SCREAMING_SNAKE_CASE_		)
            lowercase														=	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) = }""")





class      A__							:






				def __init__(						self					:      Optional[Any]    ,     a					:      list   ):






							'''simple docstring'''







							lowerCAmelCase__      :      Dict         =		set_counts
							lowerCAmelCase__      :      str         =		max(a   )
							lowerCAmelCase__      :      Any         =		len(a   )
							lowerCAmelCase__      :      List[str]         =		[1] * num_sets
							lowerCAmelCase__      :      Dict         =		list(range(a   )   )






				def 							_lowerCamelCase		(						self					:      Dict    ,     a					:      int    ,     a					:      int   ):






							'''simple docstring'''







							lowerCAmelCase__      :      Optional[Any]         =		self.get_parent(a   )
							lowerCAmelCase__      :      Tuple         =		self.get_parent(a   )

							if src_parent == dst_parent:
										return False

							if self.ranks[dst_parent] >= self.ranks[src_parent]:
										self.set_counts[dst_parent] += self.set_counts[src_parent]
										lowerCAmelCase__      :      Tuple         =		0
										lowerCAmelCase__      :      str         =		dst_parent
										if self.ranks[dst_parent] == self.ranks[src_parent]:
													self.ranks[dst_parent] += 1
										lowerCAmelCase__      :      List[Any]         =		self.set_counts[dst_parent]
							else:
										self.set_counts[src_parent] += self.set_counts[dst_parent]
										lowerCAmelCase__      :      Optional[int]         =		0
										lowerCAmelCase__      :      Tuple         =		src_parent
										lowerCAmelCase__      :      Optional[int]         =		self.set_counts[src_parent]

							lowerCAmelCase__      :      Optional[Any]         =		max(self.max_set    ,     a   )
							return True






				def 							_lowerCamelCase		(						self					:      Any    ,     a					:      int   ):






							'''simple docstring'''







							if self.parents[disj_set] == disj_set:
										return disj_set
							lowerCAmelCase__      :      Tuple         =		self.get_parent(self.parents[disj_set]   )
							return self.parents[disj_set]