Solutions in place
This commit is contained in:
parent
e198c13b95
commit
d01f07eea0
|
@ -32,12 +32,12 @@ 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
|
||||
return range_min + ratio(value, domain_min, domain_max) * (range_max - range_min)
|
||||
|
||||
def get_x_values(points):
|
||||
"Returns the first value for each point in points."
|
||||
raise NotImplementedError
|
||||
return [x for x, y in points]
|
||||
|
||||
def get_y_values(points):
|
||||
"Returns the second value for each point in points."
|
||||
raise NotImplementedError
|
||||
return [y for x, y in points]
|
||||
|
|
Loading…
Reference in New Issue