v923z / micropython-ulab

a numpy-like fast vector module for micropython, circuitpython, and their derivatives
https://micropython-ulab.readthedocs.io/en/latest
MIT License
422 stars 116 forks source link

[FEATURE REQUEST] numpy.hypot #562

Closed mnai01 closed 1 year ago

mnai01 commented 1 year ago

https://numpy.org/doc/stable/reference/generated/numpy.hypot.html

v923z commented 1 year ago

Is this not just a shortcut for qrt(x1**2 + x2**2)? If so, wouldn't it better to add this as a snippet? I try to steer clear of just aliases, given that they add to the firmware, while they don't introduce new functionality.

mnai01 commented 1 year ago

Yes, you're correct I found this out after the post. sqrt(x1**2 + x2**2) should work fine, I just have yet to test it.