Revert last change

This commit is contained in:
Grant Sanderson
2020-02-23 22:58:34 +00:00
parent 26dccfe9a7
commit d794ff8bc9

View File

@ -108,18 +108,21 @@ class CoordinateSystem():
return graph
def input_to_graph_point(self, x, graph):
alpha = binary_search(
function=lambda a: self.x_axis.p2n(
graph.point_from_proportion(a)
),
target=x,
lower_bound=self.x_min,
upper_bound=self.x_max,
)
if alpha is not None:
return graph.point_from_proportion(alpha)
if hasattr(graph, "underlying_function"):
return self.coords_to_point(x, graph.underlying_function(x))
else:
return None
alpha = binary_search(
function=lambda a: self.point_to_coords(
graph.point_from_proportion(a)
)[0],
target=x,
lower_bound=self.x_min,
upper_bound=self.x_max,
)
if alpha is not None:
return graph.point_from_proportion(alpha)
else:
return None
class Axes(VGroup, CoordinateSystem):