



from math import sqrt

import numpy as np
from sympy import symbols

# Coefficient
# Speed of light (m/s)
_lowerCamelCase    :		List[Any]		      =    299_792_458

# Symbols
_lowerCamelCase      ,						_lowerCamelCase      ,						_lowerCamelCase      ,						_lowerCamelCase    :		List[Any]		      =    symbols("""ct x y z""")

def        __a			(   __lowerCAmelCase   )     ->     float:
					if velocity > c:
										raise ValueError('Speed must not exceed light speed 299,792,458 [m/s]!'   )
					elif velocity < 1:
										# Usually the speed should be much higher than 1 (c order of magnitude)
										raise ValueError('Speed must be greater than or equal to 1!'   )

					return velocity / c

def        __a			(   __lowerCAmelCase   )     ->     float:
					return 1 / sqrt(1 - beta(__lowerCAmelCase   ) ** 2   )

def        __a			(   __lowerCAmelCase   )     ->     np.ndarray:
					return np.array(
					    [
					        [gamma(__lowerCAmelCase   ), -gamma(__lowerCAmelCase   ) * beta(__lowerCAmelCase   ), 0, 0],
					        [-gamma(__lowerCAmelCase   ) * beta(__lowerCAmelCase   ), gamma(__lowerCAmelCase   ), 0, 0],
					        [0, 0, 1, 0],
					        [0, 0, 0, 1],
					    ]   )

def        __a			(   __lowerCAmelCase      ,	__lowerCAmelCase = None   )     ->     np.ndarray:
					# Ensure event is not empty
					if event is None:
										SCREAMING_SNAKE_CASE							:     Any						=				np.array([ct, x, y, z]   )  # Symbolic four vector
					else:
										event[0] *= c  # x0 is ct (speed of light * time)

					return transformation_matrix(__lowerCAmelCase   ) @ event


if __name__ == "__main__":
			import doctest

			doctest.testmod()

			# Example of symbolic vector:
			_lowerCamelCase    :		List[str]		      =    transform(29_979_245)
			print("""Example of four vector: """)
			print(f"""ct' = {four_vector[0]}""")
			print(f"""x' = {four_vector[1]}""")
			print(f"""y' = {four_vector[2]}""")
			print(f"""z' = {four_vector[3]}""")

			# Substitute symbols with numerical values
			_lowerCamelCase    :		Dict		      =    {ct: c, x: 1, y: 1, z: 1}
			_lowerCamelCase    :		Any		      =    [four_vector[i].subs(sub_dict) for i in range(4)]

			print(f"""\n{numerical_vector}""")




from __future__ import annotations

import numpy as np

def        __a			(   __lowerCAmelCase   )     ->     Optional[Any]:
					return np.maximum(0      ,	__lowerCAmelCase   )


if __name__ == "__main__":
			print(np.array(relu([-1, 0, 5])))  # --> [0, 0, 5]