Skip to content

Commit

Permalink
Update and rename quicksolve to graph
Browse files Browse the repository at this point in the history
  • Loading branch information
j-br0 authored Feb 11, 2017
1 parent 3b2426a commit 931d406
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 19 deletions.
30 changes: 30 additions & 0 deletions graph
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import matplotlib.pyplot as plt

plt.figure()

def graph_runs():
runtimes = []
swimtimes = []
totaltimes = []
x = []
for i in range(100000):
r = i/1000
nr = 100 - r
s = ((nr ** 2) + (100 ** 2)) ** .5
timerun = r * .15
timeswum = s * .75
timeall = timerun + timeswum
runtimes.append(timerun)
swimtimes.append(timeswum)
totaltimes.append(timeall)
x.append(r)
plt.plot(x, totaltimes, label = "Total Time")
plt.xlabel("Distance Run")
plt.ylabel("Time")
plt.savefig("swimgraph1.png")
plt.plot(x, runtimes, label = "Time Running")
plt.plot(x, swimtimes, label = "Time Swimming")
plt.legend(loc="best")
plt.savefig("swimgraph2.png")

graph_runs()
19 changes: 0 additions & 19 deletions quicksolve

This file was deleted.

0 comments on commit 931d406

Please sign in to comment.