mirror of
https://github.com/3b1b/manim.git
synced 2025-11-14 18:47:46 +00:00
Axes.get_v_line_to_graph and Axes.get_h_line_to_graph
This commit is contained in:
parent
e6fc323b6d
commit
700d7c6def
1 changed files with 8 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue