Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import sin
- D1=float(input('Введите начало отсчета: '))
- D2=float(input('Введите конец отсчета: '))
- step=float(input('Введите шаг цикла: '))
- max=-99999
- min=99999
- x=D1
- while D1<=x<=D2:
- if x>max:
- max=x
- if x<min:
- min=x
- x+=step
- while D2<=x<=D1:
- if x>max:
- max=x
- if x<min:
- min=x
- x-=step
- Fmin=sin(min)
- Fmax=sin(max)
- print(end='\n')
- print(end='\n')
- print(end='\n')
- print(' '*2,'y')
- print(' '*5,'{:.2}'.format(float(Fmin)),' '*20,end='')
- print('{:.2}'.format(float(Fmax)))
- print(' '*7,'|_','_'*24,'|',sep='')
- x=D1
- print('x')
- print(end='\n')
- Sr=[]
- Sr.append(Fmin)
- Sr.append(Fmax)
- x=D1
- while D1<=x<=D2:
- Fx=sin(x)
- if Sr[0]<0:
- m=(-Fmin)/(Fmax-Fmin)+1
- elif Sr[0]>0 and Sr[1]<0:
- m=(-Fmin)/(Fmax-Fmin)+1
- print(' '*20,'|')
- m=(Fx-Fmin)/(Fmax-Fmin)+1
- print(x,' '*int(m)*12,' *')
- x+=step
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement