



from math import cos, sin







def       lowerCamelCase_  (    _a       :						float    ):



    '''simple docstring'''




    UpperCAmelCase_     :       str  		=					float(_a    )
    return [[scaling_factor * int(x == y    ) for x in range(2    )] for y in range(2    )]







def       lowerCamelCase_  (    _a       :						float    ):



    '''simple docstring'''




    UpperCAmelCase_		, UpperCAmelCase_     :       List[str]  		=					cos(_a    ), sin(_a    )
    return [[c, -s], [s, c]]







def       lowerCamelCase_  (    _a       :						float    ):



    '''simple docstring'''




    UpperCAmelCase_		, UpperCAmelCase_     :       Optional[Any]  		=					cos(_a    ), sin(_a    )
    UpperCAmelCase_     :       Dict  		=					c * s
    return [[c * c, cs], [cs, s * s]]







def       lowerCamelCase_  (    _a       :						float    ):



    '''simple docstring'''




    UpperCAmelCase_		, UpperCAmelCase_     :       List[Any]  		=					cos(_a    ), sin(_a    )
    UpperCAmelCase_     :       Optional[Any]  		=					c * s
    return [[2 * c - 1, 2 * cs], [2 * cs, 2 * s - 1]]


print(F"    {scaling(5) = }")
print(F"  {rotation(45) = }")
print(F"{projection(45) = }")






print(F"{reflection(45) = }")



import math
import os

import cva
import numpy as np

lowercase_									=    255.0
def 		_snake_case(       SCREAMING_SNAKE_CASE__     :      float       ,     SCREAMING_SNAKE_CASE__     :      float )				-> float:





    '''simple docstring'''






    A__        =  np.mean((original - contrast) ** 2 )
    if mse == 0:
        return 100

    return 20 * math.logaa(PIXEL_MAX / math.sqrt(SCREAMING_SNAKE_CASE__ ) )
def 		_snake_case(       )				-> None:





    '''simple docstring'''






    A__        =  os.path.dirname(os.path.realpath(SCREAMING_SNAKE_CASE__ ) )
    # Loading images (original image and compressed image)
    A__        =  cva.imread(os.path.join(SCREAMING_SNAKE_CASE__       ,     'image_data/original_image.png' ) )
    A__        =  cva.imread(os.path.join(SCREAMING_SNAKE_CASE__       ,     'image_data/compressed_image.png' )       ,     1 )

    A__        =  cva.imread(os.path.join(SCREAMING_SNAKE_CASE__       ,     'image_data/PSNR-example-base.png' ) )
    A__        =  cva.imread(
        os.path.join(SCREAMING_SNAKE_CASE__       ,     'image_data/PSNR-example-comp-10.jpg' )       ,     1 )

    # Value expected: 29.73dB
    print('-- First Test --' )
    print(f'PSNR value is {peak_signal_to_noise_ratio(SCREAMING_SNAKE_CASE__       ,     SCREAMING_SNAKE_CASE__ )} dB' )

    # # Value expected: 31.53dB (Wikipedia Example)
    print('\n-- Second Test --' )
    print(f'PSNR value is {peak_signal_to_noise_ratio(SCREAMING_SNAKE_CASE__       ,     SCREAMING_SNAKE_CASE__ )} dB' )


if __name__ == "__main__":
     main()

