interpolation via blt::vector

interpolation

#!/usr/bin/tclsh

package require Tk
package require BLT
namespace import ::blt::*

vector create ::X ::Y ::x ::y
::X set {0 1 2 3 4 5 6 7 8 9 10}
::Y expr {::X ^ 2.2}

::x set {10}
::y set {0}
set ::xx 10

pack [graph .g] -expand 1   -fill both
.g element create expo -xdata ::X -ydata ::Y -color red -symbol ""
.g element create inter -xdata ::x -ydata ::y -color blue

scale .sc -from 0 -to 10 -variable ::xx -orient horizontal -label x -resolution 0.1
pack .sc -side top -fill x -expand 1
label .lx -text "::x :"
label .vx -textvariable ::xx -width 10
label .ly -text "::y :"
label .vy -textvariable ::yy -width 10
pack .lx .vx .ly .vy -side left


proc trcproc {var elem op} {
        set ::x(0) $::xx
        spline natural ::X ::Y ::x ::y
        set ::yy $::y(0)
}
trace add variable ::xx write trcproc

#end