Last active
January 19, 2018 07:36
-
-
Save vadim8kiselev/f3ee94e47a299ac0556aadcae540da0d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import sys | |
from graphics import * | |
win = GraphWin('Kiselev: 1.1#2', 300, 300) | |
#win.yUp() # make right side up coordinates! | |
pt = Point(100, 50) | |
pt.draw(win) | |
line = Line(pt, Point(150, 100)) | |
line.draw(win) | |
def function(current_degree, room_degree = 20, coefficient = 0.02): | |
return -coefficient * (current_degree - room_degree) | |
def main(): | |
x = 150 # Start value | |
y = 40 # End value | |
for h in [i * 0.01 for i in range(1, 200)]: | |
if int(x) == y: | |
print ('The bread was cold for ' + str(round(x, 5)) + ' t.') | |
#break | |
print ("x: (" + str(round(h, 3)) + "): " + str(round(x, 5))) | |
x = x + h * function(x) | |
#main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment