pspline 5.0.5 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -5
  3. data/README.md +44 -43
  4. data/Rakefile +6 -6
  5. data/bin/console +14 -14
  6. data/bin/setup +8 -8
  7. data/ext/pspline/basis.cpp +394 -351
  8. data/ext/pspline/example/exbspline.rb +57 -57
  9. data/ext/pspline/example/excspline.rb +57 -57
  10. data/ext/pspline/example/exdspline.rb +55 -55
  11. data/ext/pspline/example/exfspline.rb +44 -44
  12. data/ext/pspline/example/exfspline1.rb +40 -40
  13. data/ext/pspline/example/exfspline2.rb +68 -68
  14. data/ext/pspline/example/exfspline3.rb +64 -64
  15. data/ext/pspline/example/exmspline.rb +68 -68
  16. data/ext/pspline/example/expspline.rb +29 -29
  17. data/ext/pspline/example/expspline1.rb +29 -29
  18. data/ext/pspline/example/expspline2.rb +47 -47
  19. data/ext/pspline/example/exqspline.rb +31 -31
  20. data/ext/pspline/example/exqspline1.rb +31 -31
  21. data/ext/pspline/example/exqspline2.rb +50 -50
  22. data/ext/pspline/example/exqspline3.rb +51 -51
  23. data/ext/pspline/example/exqspline4.rb +35 -35
  24. data/ext/pspline/example/exrspline.rb +34 -34
  25. data/ext/pspline/example/exrspline1.rb +34 -34
  26. data/ext/pspline/example/exrspline2.rb +44 -44
  27. data/ext/pspline/example/exsspline.rb +35 -35
  28. data/ext/pspline/example/exsspline1.rb +35 -35
  29. data/ext/pspline/example/extspline.rb +54 -54
  30. data/ext/pspline/extconf.rb +7 -7
  31. data/ext/pspline/fft.cpp +27 -552
  32. data/ext/pspline/include/basis/basis.h +145 -137
  33. data/ext/pspline/include/basis/fft.h +188 -152
  34. data/ext/pspline/include/basis/fft_complex.h +215 -0
  35. data/ext/pspline/include/basis/fft_real.h +625 -0
  36. data/ext/pspline/include/basis/gabs.h +35 -0
  37. data/ext/pspline/include/basis/marray_class_ext.h +568 -0
  38. data/ext/pspline/include/basis/marray_ext.h +100 -0
  39. data/ext/pspline/include/basis/matrix_luc_ext.h +300 -0
  40. data/ext/pspline/include/basis/matrix_lud_ext.h +298 -0
  41. data/ext/pspline/include/basis/poly.h +454 -0
  42. data/ext/pspline/include/basis/poly_array.h +1030 -1568
  43. data/ext/pspline/include/basis/pspline.h +806 -642
  44. data/ext/pspline/include/basis/real.h +526 -0
  45. data/ext/pspline/include/basis/real_inline.h +442 -0
  46. data/ext/pspline/include/basis/spline.h +83 -0
  47. data/ext/pspline/include/basis/uspline.h +251 -210
  48. data/ext/pspline/include/basis/util.h +122 -656
  49. data/ext/pspline/include/bspline.h +71 -377
  50. data/ext/pspline/include/bspline_Config.h +8 -2
  51. data/ext/pspline/include/real_config.h +3 -0
  52. data/ext/pspline/pspline.cpp +1236 -1038
  53. data/ext/pspline/real.cpp +1607 -0
  54. data/ext/pspline/real_const.cpp +585 -0
  55. data/lib/pspline.rb +71 -71
  56. data/lib/pspline/version.rb +1 -1
  57. data/pspline.gemspec +25 -25
  58. metadata +17 -5
  59. data/ext/pspline/plotsub.cpp +0 -139
  60. data/ext/pspline/util.cpp +0 -483
@@ -1,29 +1,29 @@
1
- #! /usr/local/bin/ruby
2
- require 'pspline'
3
- include PSPLINE
4
-
5
- puts "# Parametric spline interpolation"
6
-
7
- XY = [ [0, 1.0, 0.0], [1, 0.0, 1.0], [2,-1.0, 0.0], [3, 0.0,-1.0],
8
- [4, 2.0, 0.0], [5, 0.0, 2.0], [6,-2.0, 0.0], [7, 0.0,-2.0] ]
9
- Jbn = ARGV[0].to_i
10
- Dp = 20
11
-
12
- Qs = Bspline.new(XY, 8, 2)
13
-
14
- vv = []
15
- XY.each do |p|
16
- printf "<% .1f % .1f>\n", p[1], p[2]
17
- vv.push p[0]
18
- end
19
- printf "# value of interpolation points, Dp = %d", Dp
20
- if Jbn == 0
21
- print "\n"
22
- else
23
- printf ", Jbn = %d\n", Jbn
24
- end
25
- s = Qs.plot(vv, Dp, Jbn) do |a, b|
26
- c = Qs.sekibun(a);
27
- printf "% .2f % .7f % .7f % .7f % .7f\n", a, b[0], b[1], c[0], c[1]
28
- end
29
- #STDERR.puts s
1
+ #! /usr/local/bin/ruby
2
+ require 'pspline'
3
+ include PSPLINE
4
+
5
+ puts "# Parametric spline interpolation"
6
+
7
+ XY = [ [0, 1.0, 0.0], [1, 0.0, 1.0], [2,-1.0, 0.0], [3, 0.0,-1.0],
8
+ [4, 2.0, 0.0], [5, 0.0, 2.0], [6,-2.0, 0.0], [7, 0.0,-2.0] ]
9
+ Jbn = ARGV[0].to_i
10
+ Dp = 20
11
+
12
+ Qs = Bspline.new(XY, 8, 2)
13
+
14
+ vv = []
15
+ XY.each do |p|
16
+ printf "<% .1f % .1f>\n", p[1], p[2]
17
+ vv.push p[0]
18
+ end
19
+ printf "# value of interpolation points, Dp = %d", Dp
20
+ if Jbn == 0
21
+ print "\n"
22
+ else
23
+ printf ", Jbn = %d\n", Jbn
24
+ end
25
+ s = Qs.plot(vv, Dp, Jbn) do |a, b|
26
+ c = Qs.sekibun(a);
27
+ printf "% .2f % .7f % .7f % .7f % .7f\n", a, b[0], b[1], c[0], c[1]
28
+ end
29
+ #STDERR.puts s
@@ -1,47 +1,47 @@
1
- #! /usr/local/bin/ruby
2
- require 'pspline'
3
- include PSPLINE
4
-
5
- # Parametric interpolation
6
-
7
- nn = [5, 3]
8
- jj = [3, 2]
9
- ss = [0, 0]
10
-
11
- puts "# 2 variable 3 dimension parametric spline interpolation"
12
-
13
- S = [0, 1, 2, 3, 4]
14
- T = [0, 1, 2]
15
-
16
- XYZ = [ [[ 2.0,-1.0,-2.0], [ 2.0,-2.0,-1.0], [ 2.0,-2.0,-3.0]],
17
- [[ 1.0, 0.0,-1.0], [ 1.0,-1.0, 0.0], [ 1.0,-1.0,-2.0]],
18
- [[ 0.0, 2.0, 0.0], [ 0.0, 0.0, 2.0], [ 0.0, 0.0,-2.0]],
19
- [[-1.0, 2.0, 1.0], [-1.0, 1.0, 2.0], [-1.0, 1.0, 0.0]],
20
- [[-2.0, 3.0, 2.0], [-2.0, 2.0, 3.0], [-2.0, 2.0, 1.0]] ]
21
-
22
- Jbn = ARGV[0].to_i
23
-
24
- Dp = 10
25
-
26
- Ps = Pspline.new(XYZ, [S, T], nn, jj, ss)
27
-
28
- for i in 0..4
29
- for j in 0..2
30
- printf "%d,%d", S[i], T[j]
31
- u = XYZ[i][j]
32
- printf " <% .1f % .1f % .1f>\n", u[0], u[1], u[2]
33
- end
34
- end
35
- printf "# value of interpolation points, Dp = %d", Dp
36
- if Jbn == 0
37
- print "\n"
38
- else
39
- printf ", Jbn = %d\n", Jbn
40
- end
41
- vv = [S, T]
42
- N = Ps.plot(vv, Dp, [Jbn,0]) do |a, b|
43
- if (a[0] == 0.1)
44
- printf "% .2f % .2f % f % f % f\n", a[0], a[1], b[0], b[1], b[2]
45
- end
46
- end
47
- #STDERR.puts N
1
+ #! /usr/local/bin/ruby
2
+ require 'pspline'
3
+ include PSPLINE
4
+
5
+ # Parametric interpolation
6
+
7
+ nn = [5, 3]
8
+ jj = [3, 2]
9
+ ss = [0, 0]
10
+
11
+ puts "# 2 variable 3 dimension parametric spline interpolation"
12
+
13
+ S = [0, 1, 2, 3, 4]
14
+ T = [0, 1, 2]
15
+
16
+ XYZ = [ [[ 2.0,-1.0,-2.0], [ 2.0,-2.0,-1.0], [ 2.0,-2.0,-3.0]],
17
+ [[ 1.0, 0.0,-1.0], [ 1.0,-1.0, 0.0], [ 1.0,-1.0,-2.0]],
18
+ [[ 0.0, 2.0, 0.0], [ 0.0, 0.0, 2.0], [ 0.0, 0.0,-2.0]],
19
+ [[-1.0, 2.0, 1.0], [-1.0, 1.0, 2.0], [-1.0, 1.0, 0.0]],
20
+ [[-2.0, 3.0, 2.0], [-2.0, 2.0, 3.0], [-2.0, 2.0, 1.0]] ]
21
+
22
+ Jbn = ARGV[0].to_i
23
+
24
+ Dp = 10
25
+
26
+ Ps = Pspline.new(XYZ, [S, T], nn, jj, ss)
27
+
28
+ for i in 0..4
29
+ for j in 0..2
30
+ printf "%d,%d", S[i], T[j]
31
+ u = XYZ[i][j]
32
+ printf " <% .1f % .1f % .1f>\n", u[0], u[1], u[2]
33
+ end
34
+ end
35
+ printf "# value of interpolation points, Dp = %d", Dp
36
+ if Jbn == 0
37
+ print "\n"
38
+ else
39
+ printf ", Jbn = %d\n", Jbn
40
+ end
41
+ vv = [S, T]
42
+ N = Ps.plot(vv, Dp, [Jbn,0]) do |a, b|
43
+ if (a[0] == 0.1)
44
+ printf "% .2f % .2f % f % f % f\n", a[0], a[1], b[0], b[1], b[2]
45
+ end
46
+ end
47
+ #STDERR.puts N
@@ -1,31 +1,31 @@
1
- #! /usr/local/bin/ruby
2
- require 'pspline'
3
- include PSPLINE
4
-
5
- puts "# parametric period interpolation (Closed curve interpolation)"
6
-
7
- X = [0, 1, 2, 3, 4, 5, 6, 7, 8]
8
-
9
- Y = [ [ 1.0, 0.0],[ 0.707107, 0.707107],[ 0.0, 1.0],[-0.707107, 0.707107],
10
- [-1.0, 0.0],[-0.707107,-0.707107],[ 0.0,-1.0],[ 0.707107,-0.707107] ]
11
-
12
- Jbn = ARGV[0].to_i
13
-
14
- Dp = 8
15
-
16
- Qs = Pspline.new(Y, [X], [8], [5], [1])
17
-
18
- Y.each do |p|
19
- printf "% f, % f\n", p[0], p[1]
20
- end
21
- printf "# value of interpolation points, Dp = %d", Dp
22
- if Jbn == 0
23
- print "\n"
24
- else
25
- printf ", Jbn = %d\n", Jbn
26
- end
27
- vv = [X]
28
- s = Qs.plot(vv, Dp, [Jbn]) do |a, b|
29
- printf "% .3f % f % f\n", a[0], b[0], b[1]
30
- end
31
- #STDERR.puts s
1
+ #! /usr/local/bin/ruby
2
+ require 'pspline'
3
+ include PSPLINE
4
+
5
+ puts "# parametric period interpolation (Closed curve interpolation)"
6
+
7
+ X = [0, 1, 2, 3, 4, 5, 6, 7, 8]
8
+
9
+ Y = [ [ 1.0, 0.0],[ 0.707107, 0.707107],[ 0.0, 1.0],[-0.707107, 0.707107],
10
+ [-1.0, 0.0],[-0.707107,-0.707107],[ 0.0,-1.0],[ 0.707107,-0.707107] ]
11
+
12
+ Jbn = ARGV[0].to_i
13
+
14
+ Dp = 8
15
+
16
+ Qs = Pspline.new(Y, [X], [8], [5], [1])
17
+
18
+ Y.each do |p|
19
+ printf "% f, % f\n", p[0], p[1]
20
+ end
21
+ printf "# value of interpolation points, Dp = %d", Dp
22
+ if Jbn == 0
23
+ print "\n"
24
+ else
25
+ printf ", Jbn = %d\n", Jbn
26
+ end
27
+ vv = [X]
28
+ s = Qs.plot(vv, Dp, [Jbn]) do |a, b|
29
+ printf "% .3f % f % f\n", a[0], b[0], b[1]
30
+ end
31
+ #STDERR.puts s
@@ -1,31 +1,31 @@
1
- #! /usr/local/bin/ruby
2
- require 'pspline'
3
- include PSPLINE
4
-
5
- puts "# Parametric period interpolation (Closed curve interpolation)"
6
-
7
- XY = [ [0, 1.0, 0.0],[1, 0.707107, 0.707107],[2, 0.0, 1.0],[3,-0.707107, 0.707107],
8
- [4,-1.0, 0.0],[5,-0.707107,-0.707107],[6, 0.0,-1.0],[7, 0.707107,-0.707107],
9
- [8, 1.0, 0.0] ]
10
-
11
- Jbn = ARGV[0].to_i
12
-
13
- Dp = 8
14
-
15
- Qs = Bspline.new(XY, 8, 5, 1)
16
-
17
- vv = []
18
- XY.each do |p|
19
- printf "% f, % f\n", p[1], p[2]
20
- vv.push p[0]
21
- end
22
- printf "# value of interpolation points, Dp = %d", Dp
23
- if Jbn == 0
24
- print "\n"
25
- else
26
- printf ", Jbn = %d\n", Jbn
27
- end
28
- s = Qs.plot(vv, Dp, Jbn) do |a, b|
29
- printf "% .2f % f % f\n", a, b[0], b[1]
30
- end
31
- #STDERR.puts s
1
+ #! /usr/local/bin/ruby
2
+ require 'pspline'
3
+ include PSPLINE
4
+
5
+ puts "# Parametric period interpolation (Closed curve interpolation)"
6
+
7
+ XY = [ [0, 1.0, 0.0],[1, 0.707107, 0.707107],[2, 0.0, 1.0],[3,-0.707107, 0.707107],
8
+ [4,-1.0, 0.0],[5,-0.707107,-0.707107],[6, 0.0,-1.0],[7, 0.707107,-0.707107],
9
+ [8, 1.0, 0.0] ]
10
+
11
+ Jbn = ARGV[0].to_i
12
+
13
+ Dp = 8
14
+
15
+ Qs = Bspline.new(XY, 8, 5, 1)
16
+
17
+ vv = []
18
+ XY.each do |p|
19
+ printf "% f, % f\n", p[1], p[2]
20
+ vv.push p[0]
21
+ end
22
+ printf "# value of interpolation points, Dp = %d", Dp
23
+ if Jbn == 0
24
+ print "\n"
25
+ else
26
+ printf ", Jbn = %d\n", Jbn
27
+ end
28
+ s = Qs.plot(vv, Dp, Jbn) do |a, b|
29
+ printf "% .2f % f % f\n", a, b[0], b[1]
30
+ end
31
+ #STDERR.puts s
@@ -1,50 +1,50 @@
1
- #! /usr/local/bin/ruby
2
- require 'pspline'
3
- include PSPLINE
4
-
5
- # Parametric period interpolation
6
-
7
- nst = [8, 3]
8
- jst = [5, 2]
9
- sst = [1, 0]
10
-
11
- puts "# 2 variable parametric period interpolation (Closed surface interpolation)"
12
-
13
- S = [0, 1, 2, 3, 4, 5, 6, 7, 8]
14
- T = [0, 1, 2]
15
-
16
- XYZ = [ [[ 1.000000, 0.000000, 0.0],[ 1.000000, 0.000000, 1.0],[ 1.000000, 0.000000, 2.0]],
17
- [[ 0.707107, 0.707107, 0.0],[ 0.707107, 0.707107, 1.0],[ 0.707107, 0.707107, 2.0]],
18
- [[ 0.000000, 1.000000, 0.0],[ 0.000000, 1.000000, 1.0],[ 0.000000, 1.000000, 2.0]],
19
- [[-0.707107, 0.707107, 0.0],[-0.707107, 0.707107, 1.0],[-0.707107, 0.707107, 2.0]],
20
- [[-1.000000, 0.000000, 0.0],[-1.000000, 0.000000, 1.0],[-1.000000, 0.000000, 2.0]],
21
- [[-0.707107,-0.707107, 0.0],[-0.707107,-0.707107, 1.0],[-0.707107,-0.707107, 2.0]],
22
- [[ 0.000000,-1.000000, 0.0],[ 0.000000,-1.000000, 1.0],[ 0.000000,-1.000000, 2.0]],
23
- [[ 0.707107,-0.707107, 0.0],[ 0.707107,-0.707107, 1.0],[ 0.707107,-0.707107, 2.0]] ]
24
-
25
- Jbn = ARGV[0].to_i
26
-
27
- Dp = 8
28
-
29
- Qs = Pspline.new(XYZ, [S, T], nst, jst, sst)
30
-
31
- for i in 0...8
32
- for j in 0..2
33
- printf("<%d,%d>", S[i], T[j])
34
- u = XYZ[i][j]
35
- printf(" % f % f % f\n", u[0], u[1], u[2])
36
- end
37
- end
38
- printf "# value of interpolation points, Dp = %d", Dp
39
- if Jbn == 0
40
- print "\n"
41
- else
42
- printf ", Jbn = %d\n", Jbn
43
- end
44
- vv = [S, T]
45
- N = Qs.plot(vv, Dp, [Jbn,0]) do |a, b|
46
- if (a[1] == 0.125)
47
- printf("%.3f %.3f % f % f % f\n", a[0], a[1], b[0], b[1], b[2])
48
- end
49
- end
50
- #STDERR.puts N
1
+ #! /usr/local/bin/ruby
2
+ require 'pspline'
3
+ include PSPLINE
4
+
5
+ # Parametric period interpolation
6
+
7
+ nst = [8, 3]
8
+ jst = [5, 2]
9
+ sst = [1, 0]
10
+
11
+ puts "# 2 variable parametric period interpolation (Closed surface interpolation)"
12
+
13
+ S = [0, 1, 2, 3, 4, 5, 6, 7, 8]
14
+ T = [0, 1, 2]
15
+
16
+ XYZ = [ [[ 1.000000, 0.000000, 0.0],[ 1.000000, 0.000000, 1.0],[ 1.000000, 0.000000, 2.0]],
17
+ [[ 0.707107, 0.707107, 0.0],[ 0.707107, 0.707107, 1.0],[ 0.707107, 0.707107, 2.0]],
18
+ [[ 0.000000, 1.000000, 0.0],[ 0.000000, 1.000000, 1.0],[ 0.000000, 1.000000, 2.0]],
19
+ [[-0.707107, 0.707107, 0.0],[-0.707107, 0.707107, 1.0],[-0.707107, 0.707107, 2.0]],
20
+ [[-1.000000, 0.000000, 0.0],[-1.000000, 0.000000, 1.0],[-1.000000, 0.000000, 2.0]],
21
+ [[-0.707107,-0.707107, 0.0],[-0.707107,-0.707107, 1.0],[-0.707107,-0.707107, 2.0]],
22
+ [[ 0.000000,-1.000000, 0.0],[ 0.000000,-1.000000, 1.0],[ 0.000000,-1.000000, 2.0]],
23
+ [[ 0.707107,-0.707107, 0.0],[ 0.707107,-0.707107, 1.0],[ 0.707107,-0.707107, 2.0]] ]
24
+
25
+ Jbn = ARGV[0].to_i
26
+
27
+ Dp = 8
28
+
29
+ Qs = Pspline.new(XYZ, [S, T], nst, jst, sst)
30
+
31
+ for i in 0...8
32
+ for j in 0..2
33
+ printf("<%d,%d>", S[i], T[j])
34
+ u = XYZ[i][j]
35
+ printf(" % f % f % f\n", u[0], u[1], u[2])
36
+ end
37
+ end
38
+ printf "# value of interpolation points, Dp = %d", Dp
39
+ if Jbn == 0
40
+ print "\n"
41
+ else
42
+ printf ", Jbn = %d\n", Jbn
43
+ end
44
+ vv = [S, T]
45
+ N = Qs.plot(vv, Dp, [Jbn,0]) do |a, b|
46
+ if (a[1] == 0.125)
47
+ printf("%.3f %.3f % f % f % f\n", a[0], a[1], b[0], b[1], b[2])
48
+ end
49
+ end
50
+ #STDERR.puts N
@@ -1,51 +1,51 @@
1
- #! /usr/local/bin/ruby
2
- require 'pspline'
3
- include PSPLINE
4
-
5
- puts "# Parametric period interpolation"
6
-
7
- nst = [3, 8]
8
- jst = [2, 5]
9
- sst = [0, 1]
10
-
11
- puts "# 2 variable parametric period interpolation (Closed surface interpolation)"
12
-
13
- S = [0, 1, 2]
14
- T = [0, 1, 2, 3, 4, 5, 6, 7, 8]
15
-
16
- XYZ = [ [[ 1.000000, 0.000000, 0.0],[ 0.707107, 0.707107, 0.0],[ 0.000000, 1.000000, 0.0],
17
- [-0.707107, 0.707107, 0.0],[-1.000000, 0.000000, 0.0],[-0.707107,-0.707107, 0.0],
18
- [ 0.000000,-1.000000, 0.0],[ 0.707107,-0.707107, 0.0]],
19
- [[ 1.000000, 0.000000, 1.0],[ 0.707107, 0.707107, 1.0],[ 0.000000, 1.000000, 1.0],
20
- [-0.707107, 0.707107, 1.0],[-1.000000, 0.000000, 1.0],[-0.707107,-0.707107, 1.0],
21
- [ 0.000000,-1.000000, 1.0],[ 0.707107,-0.707107, 1.0]],
22
- [[ 1.000000, 0.000000, 2.0],[ 0.707107, 0.707107, 2.0],[ 0.000000, 1.000000, 2.0],
23
- [-0.707107, 0.707107, 2.0],[-1.000000, 0.000000, 2.0],[-0.707107,-0.707107, 2.0],
24
- [ 0.000000,-1.000000, 2.0],[ 0.707107,-0.707107, 2.0]] ]
25
-
26
- Dp = 8
27
-
28
- Jbn = ARGV[0].to_i
29
-
30
- Qs = Pspline.new(XYZ, [S, T], nst, jst, sst)
31
-
32
- for i in 0..2
33
- for j in 0...8
34
- printf("<%d,%d>", S[i], T[j])
35
- u = XYZ[i][j]
36
- printf(" % f % f % f\n", u[0], u[1], u[2])
37
- end
38
- end
39
- printf "# value of interpolation points, Dp = %d", Dp
40
- if Jbn == 0
41
- print "\n"
42
- else
43
- printf ", Jbn = %d\n", Jbn
44
- end
45
- vv = [S, T]
46
- N = Qs.plot(vv, Dp, [0,Jbn]) do |a, b|
47
- if (a[0] == 0.125)
48
- printf("% .3f % .3f % f % f % f\n", a[0], a[1], b[0], b[1], b[2])
49
- end
50
- end
51
- #STDERR.puts N
1
+ #! /usr/local/bin/ruby
2
+ require 'pspline'
3
+ include PSPLINE
4
+
5
+ puts "# Parametric period interpolation"
6
+
7
+ nst = [3, 8]
8
+ jst = [2, 5]
9
+ sst = [0, 1]
10
+
11
+ puts "# 2 variable parametric period interpolation (Closed surface interpolation)"
12
+
13
+ S = [0, 1, 2]
14
+ T = [0, 1, 2, 3, 4, 5, 6, 7, 8]
15
+
16
+ XYZ = [ [[ 1.000000, 0.000000, 0.0],[ 0.707107, 0.707107, 0.0],[ 0.000000, 1.000000, 0.0],
17
+ [-0.707107, 0.707107, 0.0],[-1.000000, 0.000000, 0.0],[-0.707107,-0.707107, 0.0],
18
+ [ 0.000000,-1.000000, 0.0],[ 0.707107,-0.707107, 0.0]],
19
+ [[ 1.000000, 0.000000, 1.0],[ 0.707107, 0.707107, 1.0],[ 0.000000, 1.000000, 1.0],
20
+ [-0.707107, 0.707107, 1.0],[-1.000000, 0.000000, 1.0],[-0.707107,-0.707107, 1.0],
21
+ [ 0.000000,-1.000000, 1.0],[ 0.707107,-0.707107, 1.0]],
22
+ [[ 1.000000, 0.000000, 2.0],[ 0.707107, 0.707107, 2.0],[ 0.000000, 1.000000, 2.0],
23
+ [-0.707107, 0.707107, 2.0],[-1.000000, 0.000000, 2.0],[-0.707107,-0.707107, 2.0],
24
+ [ 0.000000,-1.000000, 2.0],[ 0.707107,-0.707107, 2.0]] ]
25
+
26
+ Dp = 8
27
+
28
+ Jbn = ARGV[0].to_i
29
+
30
+ Qs = Pspline.new(XYZ, [S, T], nst, jst, sst)
31
+
32
+ for i in 0..2
33
+ for j in 0...8
34
+ printf("<%d,%d>", S[i], T[j])
35
+ u = XYZ[i][j]
36
+ printf(" % f % f % f\n", u[0], u[1], u[2])
37
+ end
38
+ end
39
+ printf "# value of interpolation points, Dp = %d", Dp
40
+ if Jbn == 0
41
+ print "\n"
42
+ else
43
+ printf ", Jbn = %d\n", Jbn
44
+ end
45
+ vv = [S, T]
46
+ N = Qs.plot(vv, Dp, [0,Jbn]) do |a, b|
47
+ if (a[0] == 0.125)
48
+ printf("% .3f % .3f % f % f % f\n", a[0], a[1], b[0], b[1], b[2])
49
+ end
50
+ end
51
+ #STDERR.puts N