Top Level Namespace
- Includes:
- BSPLINE, Math
Defined Under Namespace
Modules: BSPLINE
Constant Summary collapse
- Dp =
10- Jbn =
ARGV[0].to_i
- C =
[[0.0, 1.0],[0.0, 0.0],[6.283185, 1.0],[6.283185, 0.0]]
- D =
[1, 2, 1, 2]
Constants included from BSPLINE
Instance Method Summary collapse
-
#plotsub(bp, vp, dp, b = 0) ⇒ Object
Interpolation with boundary condition by additional data points.
Instance Method Details
#plotsub(bp, vp, dp, b = 0) ⇒ Object
Interpolation with boundary condition by additional data points
【Module】 BSPLINE 【Class】 Bspline 【Method】(1)new Initialize obj = Bspline.new([,…,[xn,yn]], j, [[xn+1,yn+1],…,]) :1 list of data points. :2 dimension :3 list of additional data points (2)[] Calculate interpolation obj obj (3)value Calculate interpolation with differential value obj.value(x, b = 0) b:order of differential value (optional)(4)sekibun Calculate interpolation with integrated value obj.sekibun(a) :result is a indefinite integral of point a obj.sekibun(a,b) :result is a definite integral of section [a,b] (5)plot obj.plot(, d, b = 0) { |x,y| … } :1 list of data points :2 number of the division :3 order of differential value (optional)
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'ext/bspline/example/excspline.rb', line 33 def plotsub(bp, vp, dp, b = 0) # # bp: Bspline Object # vp: list of data points # dp: number of the division # b : order of differential value (optional) # n = vp.size xp = [] for i in 0...n x = vp.shift xp.push x end s = (n - 1) * dp + 1 for l in 1...n dt = (xp[l] - xp[l-1]) / dp n0 = (l == 1 ? 0 : 1) for nd in n0..dp np = nd + (l-1) * dp; tp = xp[l-1] + nd * dt; yp = (b == 0) ? bp[tp] : bp.value(tp, b); vp.push [tp, yp] yield tp, yp end end return s; end |