edit: enhance and fix euclidian distance error

Signed-off-by: Stephen L. <lrq3000@gmail.com>