perp-perp distance analysis

 From:  Frenchy Pilou (PILOU)
4547.16 
@Michael
Does it possible to have the smallest curve ?
I have made some try without success but a little headache ;)
At first view some inverse sign and other trivial changements but not so easy for me :D

Added the biggest :)
http://moiscript.weebly.com/select-biggest--smallest.html

Ps What happen if there are 2 biggest equal?
Seem the first created is selected :)

Pss And it's a curious workflow : nothing must be selected before lauch the script!
I have make many try before find it by hasard :D

EDITED: 26 Sep 2011 by PILOU