Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def drawMaxAndMinPoints(pointer, xo, yo, ratio, xmin, xmax, expr):
- pointer.up()
- pointer.goto(xo, yo)
- pointer.down()
- y_coordinates = []
- maxValue = 0
- minValue = 0
- x = 0
- while x <= xmax:
- y = eval(expr)
- y_coordinates.append(y)
- screenX, screenY = screenCoor(xo, yo, ratio, x, y)
- x += 0.5
- if y > maxValue:
- maxValue = y
- pointer.color("purple")
- drawCircle(pointer, screenX, screenY)
- if y < minValue:
- minValue = y
- pointer.color("orange")
- drawCircle(pointer, screenX, screenY)
- y_coordinates = []
- x = 0
- while x >= xmin:
- y = eval(expr)
- y_coordinates.append(y)
- screenX, screenY = screenCoor(xo, yo, ratio, x, y)
- x -= 0.5
- if y > maxValue:
- maxValue = y
- pointer.color("purple")
- drawCircle(pointer, screenX, screenY)
- if y < minValue:
- minValue = y
- pointer.color("orange")
- drawCircle(pointer, screenX, screenY)
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement