Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
lehrkraefte:blc:notnagel17:start [2017/11/30 17:34] Ivo Blöchliger [Weitere Resourcen] |
lehrkraefte:blc:notnagel17:start [2017/12/05 14:06] (current) Ivo Blöchliger |
||
---|---|---|---|
Line 13: | Line 13: | ||
===== Diverses ===== | ===== Diverses ===== | ||
- | TigerJython-Code zu $e^{i\pi}+1=0$: | + | TigerJython-Code |
<code python eipi.py> | <code python eipi.py> | ||
from gpanel import * | from gpanel import * | ||
Line 48: | Line 48: | ||
makeGPanel(-2, | makeGPanel(-2, | ||
+ | |||
+ | </ | ||
+ | |||
+ | Komplexe Funktionen visualisieren: | ||
+ | <code python complexfuncs.py> | ||
+ | from gpanel import * | ||
+ | |||
+ | import cmath | ||
+ | |||
+ | def cross(z, | ||
+ | a = z.real | ||
+ | b = z.imag | ||
+ | line(a-e, | ||
+ | line(a, | ||
+ | | ||
+ | @onMouseClicked | ||
+ | def init(x,y): | ||
+ | clear() | ||
+ | # Koordinatensystem | ||
+ | setColor(" | ||
+ | line(-4, | ||
+ | line(0, | ||
+ | circle(0, | ||
+ | |||
+ | def myfunc(z): | ||
+ | return z*z*z | ||
+ | |||
+ | def show(z): | ||
+ | setColor(" | ||
+ | cross(z) | ||
+ | setColor(" | ||
+ | cross(myfunc(z)) | ||
+ | | ||
+ | @onMouseMoved | ||
+ | def mouseMoved(x, | ||
+ | show(complex(x, | ||
+ | |||
+ | makeGPanel(-4, | ||
+ | init(0,0) | ||
+ | |||
+ | </ | ||
+ | |||
+ | Kurven abbilden: | ||
+ | <code python shapeimage.py> | ||
+ | from gpanel import * | ||
+ | |||
+ | import cmath | ||
+ | |||
+ | def cross(z, | ||
+ | a = z.real | ||
+ | b = z.imag | ||
+ | line(a-e, | ||
+ | line(a, | ||
+ | | ||
+ | @onMouseClicked | ||
+ | def init(x,y): | ||
+ | clear() | ||
+ | # Koordinatensystem | ||
+ | setColor(" | ||
+ | line(-4, | ||
+ | line(0, | ||
+ | circle(0, | ||
+ | |||
+ | def myfunc(z): | ||
+ | return z*z | ||
+ | def mycircle(c, | ||
+ | for i in range(0, | ||
+ | a = i/ | ||
+ | z = c+complex(math.cos(a), | ||
+ | # | ||
+ | # b = (i % 90 - 45)/ | ||
+ | setColor(" | ||
+ | cross(z) | ||
+ | setColor(" | ||
+ | cross(f(z)) | ||
+ | | ||
+ | |||
+ | def show(z): | ||
+ | init(0,0) | ||
+ | setColor(" | ||
+ | cross(z) | ||
+ | setColor(" | ||
+ | cross(myfunc(z)) | ||
+ | mycircle(z, | ||
+ | | ||
+ | @onMouseMoved | ||
+ | def mouseMoved(x, | ||
+ | show(complex(x, | ||
+ | |||
+ | makeGPanel(-6, | ||
+ | init(0,0) | ||
</ | </ |