mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Make sure find_intersection returns a result matching the shape of inputs
This commit is contained in:
parent
84fa3de435
commit
a2606c7e37
1 changed files with 4 additions and 1 deletions
|
@ -294,7 +294,10 @@ def find_intersection(
|
||||||
denom[abs(denom) < threshold] = np.inf # So that ratio goes to 0 there
|
denom[abs(denom) < threshold] = np.inf # So that ratio goes to 0 there
|
||||||
ratio = numer / denom
|
ratio = numer / denom
|
||||||
ratio = np.repeat(ratio, n).reshape((m, n))
|
ratio = np.repeat(ratio, n).reshape((m, n))
|
||||||
return p0 + ratio * v0
|
result = p0 + ratio * v0
|
||||||
|
if m == 1:
|
||||||
|
return result[0]
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
def get_closest_point_on_line(
|
def get_closest_point_on_line(
|
||||||
|
|
Loading…
Add table
Reference in a new issue