mirror of
https://github.com/3b1b/manim.git
synced 2025-08-21 05:44:04 +00:00
No need for np.repeat in normalize_along_axis
This commit is contained in:
parent
071e7f1a74
commit
42909a94ac
1 changed files with 1 additions and 2 deletions
|
@ -193,8 +193,7 @@ def normalize_along_axis(
|
||||||
) -> np.ndarray:
|
) -> np.ndarray:
|
||||||
norms = np.sqrt((array * array).sum(axis))
|
norms = np.sqrt((array * array).sum(axis))
|
||||||
norms[norms == 0] = 1
|
norms[norms == 0] = 1
|
||||||
buffed_norms = np.repeat(norms, array.shape[axis]).reshape(array.shape)
|
return (array.T / norms).T
|
||||||
return array / buffed_norms
|
|
||||||
|
|
||||||
|
|
||||||
def get_unit_normal(
|
def get_unit_normal(
|
||||||
|
|
Loading…
Add table
Reference in a new issue