Stddraw
import math import stddraw x0 = 0.0 y0 = 0.0 x1 = 1.0 y1 = 0.0 t = math.sqrt (3.0) / 2.0 stddraw.line (x0, y0, x1, y1) stddraw.point(0.5, t/3.0) stddraw.setXscale(x0, x1) stddraw.setYscale(y0, y1) stddraw.show() # stddraw.setCanvasSize(w, h) # stddraw.setXxcale (x0, x1) # stddraw.setYsclae (y0, y1) # stddraw.setPenRadius(r) stddraw.setXscale (0,n) stddraw.setYscale (0,n) for i in range (n+1) stddraw.line (0, n-i, i, 0) stddraw.show() xd = [x-r, x, x+r, x] yd = [y, y+r, y, y-r] stddraw.polygon(xd, yd) # stddraw.circle(x, y, r) # stddraw.square(x, y, r) # stddraw.rectangle (x, y, w, h) # stddraw.polygon(x, y) # stddraw.text (x,y,s) # stddraw.setPenColor(color) # stddraw.setFontFamily(font) # stddraw.setFontSize(size) # stddraw.clear(color)
No comments:
Post a Comment