mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Fixed Divide by zero
Saw this floating around.
This commit is contained in:
parent
d7159fba3e
commit
3342f68ca2
@ -1140,8 +1140,8 @@ STATIC mp_obj_t py_image_draw_arrow(uint n_args, const mp_obj_t *args, mp_map_t
|
||||
int dy = (arg_y1 - arg_y0);
|
||||
float length = fast_sqrtf((dx * dx) + (dy * dy));
|
||||
|
||||
float ux = dx / length;
|
||||
float uy = dy / length;
|
||||
float ux = IM_DIV(dx, length);
|
||||
float uy = IM_DIV(dy, length);
|
||||
float vx = -uy;
|
||||
float vy = ux;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user