OK, so this makes my PPL program a little bit simpler:
Code:
EXPORT EXTREMA(BD)
BEGIN
// Find Next Extrema date
N:=DDAYS(BD,Date);
A:=IP(2*N/23-1/2);
B:=IP(2*N/28-1/2);
C:=IP(2*N/33-1/2);
L1:=MAKELIST(ROUND(23/2*(1/2+I),0),I,A+1,A+33);
L2:=MAKELIST(28/2*(1/2+I),I,B+1,B+33);
L3:=MAKELIST(ROUND(33/2*(1/2+I),0),I,C+1,C+33);
D:=MIN(head(INTERSECT(L1,L2)),head(INTERSECT(L2,L3)),head(INTERSECT(L1,L3)));
E:=DATEADD(BD,D);
// Display results using the Function App: first text, then a graphic view centered on the next extrema
STARTAPP("Function");
F1:='100*SIN(4*ACOS(0)*(X MOD 23)/23)';
F2:='100*SIN(4*ACOS(0)*(X MOD 28)/28)';
F3:='100*SIN(4*ACOS(0)*(X MOD 33)/33)';
Xmin:=D-40; Xmax:=D+40; Ymin:=-110; Ymax:=110; Xtick:=5; Ytick:=10;
PRINT("Birthday : "+STRING(BD,2,4));
PRINT("Next Extrema Date: "+STRING(E,2,4));
PRINT("Physical: "+ROUND(F1(D),0));
PRINT("Emotional: "+ROUND(F2(D),0));
PRINT("Intellectual: "+ROUND(F3(D),0));
CHECK({1,2,3});UNCHECK({0,4,5,6,7,8,9});
STARTVIEW(1);
RETURN E;
END;
Do you have a list of test dates and results to check?
Here are some results from the program above:
Code:
Birthday : 1955.0819
Next Extrema Date: 2018.1022
Physical: 100
Emotional: 62
Intellectual: 100
Birthday : 2018.0928
Next Extrema Date: 2018.1130
Physical: −100
Emotional: 100
Intellectual: −54
Birthday : 1963.0227
Next Extrema Date: 2018.1114
Physical: −100
Emotional: −100
Intellectual: −76
Birthday : 1905.0101
Next Extrema Date: 2018.1010
Physical: −100
Emotional: 62
Intellectual: 100