WikiSchool:Spielwiese
Aus WikiSchool
<showhide>python-quellcode >>> __HIDER__ <<< <hide>
import math, random
def gen_helix(phi=0):
print "Line[ {"
for n in range(1, 50):
x=n/2.
print "{%.2f, %.2f, %.2f} %s" % ( math.sin(x+phi), math.cos(x+phi), x, [',', ''][n==49])
print "}]"
def gen_helix_bridges():
for n in range(1, 50):
x=n/2.
colors = ("1.0, 0.0, 1.0", "0.0, 1.0, 1.0", "1.0, 1.0, 0.0", "0.0, 1.0, 0.0")
print "RGBColor[%s]," % random.choice(colors)
print "Line[ { {%.2f, %.2f, %.2f}, {%.2f, %.2f, %.2f} } ]," % (
math.sin(x), math.cos(x), x,
math.sin(x+math.pi), math.cos(x+math.pi), x,
)
print "RGBColor[0,0,0]"
print "}]"
if __name__=="__main__":
import math
print '''
<HTML>
<APPLET ARCHIVE="live.jar" CODE="Live.class" WIDTH=200 HEIGHT=400 ALIGN=CENTER>
<PARAM NAME="INPUT" VALUE="Graphics3D[
{ Thickness[.005],
'''
gen_helix()
print ","
gen_helix(math.pi)
print ","
gen_helix_bridges()
print '''}, {
ViewPoint->{0,-2,-4},
ViewVertical->{0,-5,-1},
Boxed->False
}]"></APPLET>'''</hide></showhide>
ok, genug rumgespielt....
| Was | Warum |
|---|---|
| Marcus asjdföljkasdfkjasdöfljkaösdkfljasödflkj | Schaweasdfasdfasdfa |
| Zelle 3 | Zelle 4 |
| Zelle 5 | Zelle 6 |
WIKI
Abituraufgaben
Referate
Fächer
FORUM
News
Ankündigungen
Schule
Nach der Schule
Freizeit und Miteinander
Computer & Internet
OffTopic
CHAT
IRC
Tutorial
TOOLS
html2wiki
GAMES
WIKISCHOOL
Impressum
Links