Sub Ex_Pchbs()
Const N = 4, Ne = 2
Dim X(N - 1) As Double, Y(N - 1) As Double, D(N - 1) As Double
Dim Ic(1) As Long, Vc(1) As Double
Dim Knotyp As Long, Nknots As Long, T(2 * N + 3) As Double, Bcoef(2 * N - 1) As Double
Dim Ndim As Long, Kord As Long
Dim Info As Long
'-- Data
X(0) = 0.1: Y(0) = -2.3026
X(1) = 0.11: Y(1) = -2.2073
X(2) = 0.12: Y(2) = -2.1203
X(3) = 0.13: Y(3) = -2.0402
'-- Cubic Hermite interpolation
Ic(0) = 1: Ic(1) = 1
Vc(0) = 1 / X(0): Vc(1) = 1 / X(3)
Call Pchic(Ic(), Vc(), 0, N, X(), Y(), D(), Info)
If Info <> 0 Then
Debug.Print "Error in Pchic: Info =", Info
Exit Sub
End If
'-- Convert to B-spline
Knotyp = 0
Call Pchbs(N, X(), Y(), D(), Knotyp, Nknots, T(), Bcoef(), Ndim, Kord, Info)
Debug.Print "Info =", Info
End Sub