if (ratio < 0.5 || ratio > 2.0) return 0.0; /* reasonable ratio */
- size = sqrt(xsize * xsize + ysize * ysize);
+ size = hypot(xsize, ysize);
if (size < 1.0 || size > 100.0) return 0.0; /* reasonable sensor size in mm */
- return sqrt(36*36+24*24) / size;
-
+ return hypot(36, 24) / size;
}
static gboolean remove_suffix(gchar *str, const gchar *suffix, gint suffix_len)
group->width = pi_box->width;
group->height = pi_box->y + pi_box->height;
- group->diameter = static_cast<gint>(sqrt(group->width * group->width + group->height * group->height));
+ group->diameter = static_cast<gint>(hypot(group->width, group->height));
group->children = nullptr;
guint8 n;
gint r;
- r = MIN(border, (gint)sqrt((i-sx)*(i-sx) + (j-sy)*(j-sy)));
+ r = MIN(border, (gint)hypot(i - sx, j - sy));
n = a - a * r / border;
*pp = (r * n + *pp * (256-n)) >> 8;
pp++;