[go: up one dir, main page]

Menu

[r177]: / coco / tests / h3coeff.m  Maximize  Restore  History

Download this file

62 lines (42 with data), 934 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
60
61
function [ A B C D ] = h3coeff( T, x0, t0, x1, t1, h1 )
%HERMITE Summary of this function goes here
% Detailed explanation goes here
[ A B C D ] = h3coeff_D( T, x0, t0, x1, t1, h1 );
end
function [ A B C D ] = h3coeff_A( T, x0, t0, x1, t1 )
A = x0;
B = t0;
D = t0+t1+2*(x0-x1);
C = x1-x0-t0-D;
end
function [ A B C D ] = h3coeff_B( T, x0, t0, x1, t1 )
A = x0;
B = t0;
D = (h1*(t1+t0)+2*(x0-x1))/(h1*h1*h1);
C = (x1-x0-h1*t0-D*h1*h1*h1)/(h1*h1);
end
function [ A B C D ] = h3coeff_C( T, x0, t0, x1, t1 )
h1 = (x1-x0)'*T;
x1 = x1 - h1*T;
dh0 = T'*t0;
dh1 = T'*t1;
x0s = t0/dh0-T;
x1s = t1/dh1-T;
A = x0;
B = x0s+T;
D = (h1*(x1s+x0s)+2*(x0-x1))/(h1*h1*h1);
C = (x1-x0-h1*x0s-D*h1*h1*h1)/(h1*h1);
end
function [ A B C D ] = h3coeff_D( T, x0, t0, x1, t1, hh )
T = t0+t1;
T = T/norm(T);
DX = (x1-x0)';
%t0 = t0*(DX*T);
%t1 = t1*(DX*T);
t0 = t0*hh;
t1 = t1*hh;
A = x0;
B = t0;
D = t0+t1+2*(x0-x1);
C = x1-x0-t0-D;
end