Guest User

Untitled

a guest
Oct 18th, 2019
84
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def drawMaxAndMinPoints(pointer, xo, yo, ratio, xmin, xmax, expr):
  2. pointer.up()
  3. pointer.goto(xo, yo)
  4. pointer.down()
  5. y_coordinates = []
  6. maxValue = 0
  7. minValue = 0
  8. x = 0
  9. while x <= xmax:
  10. y = eval(expr)
  11. y_coordinates.append(y)
  12. screenX, screenY = screenCoor(xo, yo, ratio, x, y)
  13. x += 0.5
  14. if y > maxValue:
  15. maxValue = y
  16. pointer.color("purple")
  17. drawCircle(pointer, screenX, screenY)
  18. if y < minValue:
  19. minValue = y
  20. pointer.color("orange")
  21. drawCircle(pointer, screenX, screenY)
  22. y_coordinates = []
  23. x = 0
  24. while x >= xmin:
  25. y = eval(expr)
  26. y_coordinates.append(y)
  27. screenX, screenY = screenCoor(xo, yo, ratio, x, y)
  28. x -= 0.5
  29. if y > maxValue:
  30. maxValue = y
  31. pointer.color("purple")
  32. drawCircle(pointer, screenX, screenY)
  33. if y < minValue:
  34. minValue = y
  35. pointer.color("orange")
  36. drawCircle(pointer, screenX, screenY)
  37. pass
RAW Paste Data