mirror of
https://github.com/3b1b/manim.git
synced 2025-08-02 11:03:03 +08:00
Revert last change
This commit is contained in:
@ -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):
|
||||
|
Reference in New Issue
Block a user