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
- from --- the from value
- to --- the to value
- nsteps --- number of numbers to generate
- format --- (optional) format of the numbers in C syntax (e.g. %15.10f)
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 }