##### Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

# Archived:Sine wave interference patterns using PySymbian

Aquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.

All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.

Tested with
Devices(s): Nokia N96
Compatibility
Platform(s): S60 2nd Edition, S60 3rd Edition
Article
Keywords: canvas
Created: cyke64 (19 Mar 2007)
Last edited: hamishwillee (31 May 2013)

## Overview

Following code provides a nice visualization in Python.

## Code

`# import modulesfrom appuifw import *import e32, randomfrom math import * # define canvasapp.body = c = Canvas()width, height =  c.size# random frequencyfreq = random.choice([25., 50., 100., 200., 400.]) # Drawfor y in range(height):    for x in range(width):        z1 = sin(x/freq*1.7*pi)        z2 = sin((x/3+y)/freq*1.5*pi)        z3 = sin(y/freq*0.1*pi)         z = abs(z1+z2+z3)*255        c.point((x,y), (z,z/4,z*4))c.text((5, height-12), u'Freq = %d' %freq, 0xffffff) e32.ao_sleep(5)    # wait 5 sec then quit`

Visual

.