TABLE OF CONTENTS


::pwtk::norm

SYNOPSIS

proc ::pwtk::norm {vec} {

PURPOSE

Return the size (norm) of an N-dimensional vector.

EXAMPLE

::pwtk::norm {1.0 2.0 0.0}

SOURCE

    set sum 0.0
    foreach comp $vec {
        set sum [expr $sum + $comp*$comp]
    }
    return [expr sqrt($sum)]
}