TABLE OF CONTENTS


::pwtk::doubleSeq

SYNOPSIS

proc ::pwtk::doubleSeq {from to nsteps {fmt %s}} {

USAGE

   ::pwtk::doubleSeq from to nsteps ?format?

PURPOSE

Return an equispaced sequence of 'nsteps' double (real) numbers in the [from,to] range.

ARGUMENTS

SOURCE

    set d [expr (($to) - ($from)) / double($nsteps - 1)]
    if { $nsteps <= 0.0 } { return $from }
    for {set i 0} {$i < $nsteps} {incr i} {        
        lappend result [format $fmt [expr $from + double($i)*$d]]
    }
    return $result
}