Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Lib/turtle.py
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,8 @@ def setworldcoordinates(self, llx, lly, urx, ury):
self.mode("world")
xspan = float(urx - llx)
yspan = float(ury - lly)
if xspan == 0 or yspan == 0:
raise ValueError("Width and height must be greater than zero")
wx, wy = self._window_size()
self.screensize(wx-20, wy-20)
oldxscale, oldyscale = self.xscale, self.yscale
Expand Down Expand Up @@ -2055,6 +2057,8 @@ def circle(self, radius, extent = None, steps = None):
if steps is None:
frac = abs(extent)/self._fullcircle
steps = 1+int(min(11+abs(radius)/6.0, 59.0)*frac)
if steps == 0:
raise ValueError("steps must not be zero")
w = 1.0 * extent / steps
w2 = 0.5 * w
l = 2.0 * radius * math.sin(math.radians(w2)*self._degreesPerAU)
Expand Down
Loading