Miratges P31729


Statement
 

Graphic problem

pdf   zip

html

Feu un programa que generi “miratges” usant la funció sin de math.

Entrada

L’entrada consisteix en tres naturals estrictament positius m, n i d, seguits de sis enters rx, ry, gx, gy, bx, i by.

Sortida

Cal generar una imatge (m, n). Per assignar la intensitat de vermell a cada punt (x, y), primer calculeu el nombre real rx · sin(x/d) + ry · sin(y/d). Després, passeu aquest real a enter, i calculeu-ne el residu mòdul 256. Per a les intensitats de verd i blau, feu càlculs similars, però usant gx i gy, o bé bx i by, respectivament.

Public test cases
  • Input

    400
    350
    20
    60
    60
    100
    0
    0
    100
    

    Output

    sample-1.png

     (400×350)

  • Input

    600
    400
    20
    4
    -2
    -2
    2
    4
    -4
    

    Output

    sample-2.png

     (600×400)

  • Input

    400
    400
    50
    0
    127
    0
    0
    127
    0
    

    Output

    sample-3.png

     (400×400)

  • Information
    Author
    Salvador Roura
    Language
    Catalan
    Official solutions
    Python
    User solutions
    Python