diff --git a/transform.py b/transform.py index 172d7be..3b91721 100644 --- a/transform.py +++ b/transform.py @@ -34,9 +34,9 @@ def clamp(value, low, high): """ if value >= low and value <= high: return value - elif value > high: + elif value > high: return "High" ,m - else: + else: return "Low" def ratio(value, start, end): @@ -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