darksantos

Ejercicio140

Jun 11th, 2012
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2.  
  3. from modulepythong import *
  4.  
  5. a=float(raw_input('Ingrese a: '))
  6. b=float(raw_input('Ingrese b: '))
  7. c=float(raw_input('Ingrese c: '))
  8.  
  9. z1=float(raw_input('Ingrese z1: '))
  10. z2=float(raw_input('Ingrese z2: '))
  11.  
  12.  
  13. x=float (z1)
  14. plus=float(0.01)
  15. maxi=float(-99)
  16. mini=float(99)
  17.  
  18. while x<=z2:
  19.     y=((a*(x**2))+(b*x)+c)
  20.     x+=plus
  21.     if y > maxi :
  22.         maxi=y
  23.         #print maxi
  24.     if y < mini :
  25.         mini=y
  26.  
  27.        
  28. window_size(500, 500)
  29. window_coordinates(z1, mini, z2, maxi)
  30.  
  31. x=z1
  32.  
  33. while x <= z2 :
  34.    
  35.     y=((a*(x**2))+(b*x)+c)    
  36.     z=(a*((x+plus)**2)+(b*(x+plus))+c)
  37.     create_line(x, y, x+plus, z, 'blue')
  38.     x = x+plus
  39.    
  40.    
  41. print'Pulsa <Return> para salir: '
  42. raw_input()
Advertisement
Add Comment
Please, Sign In to add comment