generated from mwc/lab_scatter
Completed all functions for the turtle graphing exercise.
This commit is contained in:
parent
fc2336e978
commit
de61eded10
11
transform.py
11
transform.py
|
@ -49,12 +49,15 @@ def ratio(value, start, end):
|
|||
|
||||
def scale(value, domain_min, domain_max, range_min, range_max):
|
||||
"Given a value within a domain, returns the scaled equivalent within range."
|
||||
raise NotImplementedError
|
||||
#raise NotImplementedError
|
||||
r = ratio(value, domain_min, domain_max)
|
||||
return range_min + r * (range_max - range_min)
|
||||
|
||||
def get_x_values(points):
|
||||
"Returns the first value for each point in points."
|
||||
raise NotImplementedError
|
||||
x_vals = points[0]
|
||||
return x_vals
|
||||
|
||||
def get_y_values(points):
|
||||
"Returns the second value for each point in points."
|
||||
raise NotImplementedError
|
||||
y_vals = points[1]
|
||||
return y_vals
|
||||
|
|
Loading…
Reference in New Issue