- 001
- 002
- 003
- 004
- 005
- 006
- 007
- 008
- 009
- 010
- 011
- 012
- 013
- 014
- 015
- 016
- 017
- 018
- 019
- 020
- 021
- 022
- 023
- 024
- 025
- 026
- 027
- 028
- 029
- 030
- 031
- 032
- 033
- 034
- 035
- 036
- 037
- 038
- 039
- 040
- 041
- 042
- 043
- 044
- 045
- 046
- 047
- 048
- 049
- 050
- 051
- 052
- 053
- 054
- 055
- 056
- 057
- 058
- 059
- 060
- 061
- 062
- 063
- 064
- 065
- 066
- 067
- 068
- 069
- 070
- 071
- 072
- 073
- 074
- 075
- 076
- 077
- 078
- 079
- 080
- 081
- 082
- 083
- 084
- 085
- 086
- 087
- 088
- 089
- 090
- 091
- 092
- 093
- 094
- 095
- 096
- 097
- 098
- 099
- 100
...
q = new double[50];
c = new double[50];
d = new double[50];
b = new double[50];
s11 = new double[50];
a4 = new double[50];
s1 = new double[50];
int c2 = 0;
for ( int i = 1; i < n1; i++)
{
h1[i] = a3[i] - a3[i-1];
}
for ( int i = 0; i < n1; i++)
{
f1[i] = sin(exp(a3[i]));
}
for ( int i = 1; i < k; i++)
{
al[i] = h1[i];
bet[i] = 2*(h1[i+1] + h1[i]);
gam[i] = h1[i+1];
fi[i] = 6*(((f1[i+1] - f1[i])/h1[i+1]) - ((f1[i] - f1[i-1])/h1[i]));
}
p[1] = 0;
q[1] = 0;
for ( int i = 1; i < k; i++)
{
p[i+1] = -(gam[i])/(bet[i] + al[i]*p[i]);
q[i+1] = (fi[i] - al[i]*q[i])/(bet[i] + al[i]*p[i]);
}
c[0] = 0.0;
c[k] = 0.0;
for ( int i = k-1; i > 0; i--)
{
c[i] = p[i+1]*c[i+1] + q[i+1];
}
for ( int i = 0; i < k; i++)
{
d[i+1] = (c[i] - c[i+1])/h1[i+1];
b[i+1] = ((f1[i] - f1[i+1])/h1[i+1]) - ((c[i+1]*h1[i+1])/2) - (((c[i] - c[i+1])*h1[i+1])/6);
}
for ( double j = 0.0; j <= 0.5; j = j + 0.1)
{
c2 = c2 + 1;
for ( int i = 1; i < 2; i++)
{
spkub = f1[i] + b[i]*(a3[i] - j) + ((c[i]*pow((a3[i] - j), 2))/2) + ((d[i]*pow((a3[i] - j), 3))/6);
}
for (int i = c2 - 1; i < c2; i++)
{
a4[i] = j;
s1[i] = spkub;
}
}
for ( double j = 0.5; j <= 0.7; j = j + 0.1)
{
c2 = c2 + 1;
for ( int i = 2; i < 3; i++)
{
spkub = f1[i] + b[i]*(a3[i] - j) + ((c[i]*pow((a3[i] - j), 2))/2) + ((d[i]*pow((a3[i] - j), 3))/6);
}
for (int i = c2 - 1; i < c2; i++)
{
a4[i] = j;
s1[i] = spkub;
}
}
........
for ( double j = 1.4; j <= 1.6; j = j + 0.1)
{
c2 = c2 + 1;
for ( int i = 5; i < 6; i++)
{
spkub = f1[i] + b[i]*(a3[i] - j) + ((c[i]*pow((a3[i] - j), 2))/2) + ((d[i]*pow((a3[i] - j), 3))/6);
}
for (int i = c2 - 1; i < c2; i++)
{
a4[i] = j;
s1[i] = spkub;
}
}
for ( double j = 1.7; j <= 2.0; j = j + 0.1)
{
c2 = c2 + 1;
for ( int i = 6; i < 7; i++)
{
spkub = f1[i] + b[i]*(a3[i] - j) + ((c[i]*pow((a3[i] - j), 2))/2) + ((d[i]*pow((a3[i] - j), 3))/6);
}
for (int i = c2 - 1; i < c2; i++)
{
a4[i] = j;
s1[i] = spkub;
}
}
for ( int i = 0; i < c2; i++)
{
chart1 -> Series["Кубический сплайн S(x)"] -> Points -> AddXY( a4[i], s1[i]);
}
TheHamstertamer 01.04.2012 10:27 # +1
absolut 02.04.2012 01:10 # +4
3.14159265 02.04.2012 13:41 # +1
Lure Of Chaos 01.04.2012 10:37 # +2
rat4 01.04.2012 14:27 # −1
guest8 09.04.2019 12:58 # −999