CSharp MakeUnit
From scripting
static double[] MakeUnit(double[] a ) { double L = ArrayVectorMag(a); double[] K = {a[0] / L, a[1] / L, a[2] / L}; return K; }
This subroutine was used in the development of the Mega-Dots World's Toughest Connect-the-Dots Puzzles.
Unrelated MEL scripting help located here: YSYT.