Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
lehrkraefte:blc:notnagel17:start [2017/11/30 17:47]
Ivo Blöchliger [Diverses]
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 (nur lauffähig auf neueren Versions) zu $e^{i\pi}+1=0$:
 <code python eipi.py> <code python eipi.py>
 from gpanel import * from gpanel import *
Line 86: Line 86:
  
 makeGPanel(-4, 4, -4, 4) makeGPanel(-4, 4, -4, 4)
 +init(0,0)
 +
 +</code>
 +
 +Kurven abbilden:
 +<code python shapeimage.py>
 +from gpanel import *
 +
 +import cmath
 +
 +def cross(z,e=0.01):
 +    a = z.real
 +    b = z.imag
 +    line(a-e,b,a+e,b)
 +    line(a,b-e,a,b+e)
 +    
 +@onMouseClicked
 +def init(x,y):
 +    clear()
 +    # Koordinatensystem
 +    setColor("black");
 +    line(-4,0,4,0)
 +    line(0,-4,0,4)
 +    circle(0,0,1)
 +
 +def myfunc(z):     
 +    return z*z
 +def mycircle(c,r=1.0, f=myfunc):
 +    for i in range(0,360):
 +        a = i/180.0*math.pi
 +        z = c+complex(math.cos(a),math.sin(a))*r
 + #       z = c+complex(math.cos(a),math.sin(a))*r*(1+math.cos(a*20)*0.1)
 +#        b = (i % 90 - 45)/180.0*math.pi ;  z = c+complex(math.cos(a),math.sin(a))*r*math.sqrt(math.tan(b)**2+1)
 +        setColor("blue")
 +        cross(z)
 +        setColor("red")
 +        cross(f(z))
 +    
 +
 +def show(z):
 +    init(0,0)
 +    setColor("black")
 +    cross(z)
 +    setColor("red")
 +    cross(myfunc(z))
 +    mycircle(z,1.0, myfunc)
 +    
 +@onMouseMoved
 +def mouseMoved(x,y):
 +    show(complex(x,y));
 +
 +makeGPanel(-6, 6, -6, 6)
 init(0,0) init(0,0)
  
 </code> </code>
  • lehrkraefte/blc/notnagel17/start.1512060478.txt.gz
  • Last modified: 2017/11/30 17:47
  • by Ivo Blöchliger