Axes.get_v_line_to_graph and Axes.get_h_line_to_graph

This commit is contained in:
Grant Sanderson 2021-02-07 09:56:28 -08:00
parent e6fc323b6d
commit 700d7c6def

View file

@ -173,12 +173,19 @@ class CoordinateSystem():
label.shift_onto_screen()
return label
def get_vertical_line_to_graph(self, x, graph, line_func=Line):
def get_v_line_to_graph(self, x, graph, line_func=Line):
return line_func(
self.coords_to_point(x, 0),
self.input_to_graph_point(x, graph),
)
def get_h_line_to_graph(self, x, graph, line_func=Line):
y = self.get_y_axis().p2n(self.itgp(x, graph))
return line_func(
self.coords_to_point(0, y),
self.input_to_graph_point(x, graph),
)
# For calculus
def angle_of_tangent(self, x, graph, dx=EPSILON):
p0 = self.input_to_graph_point(x, graph)