Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
Derek. Please don't post code that contains obvious errors -- it does little to foster assistance. Next, as Henry has already pointed out, look carefully at the code to see to most of it is never used in the actual computation, so unless something is hidden from us, these can be removed to simplify the code and speed up computation and execution. The time to use a variable is when it simplifies the reading of the code or the values are going to be reused; if you are not going to reuse the values just use the function where required to avoid lengthening the code and using up the 20 allowed variables. Variables themselves may be reused e.g. Code:
Period1:=Input("Cycle Period 1",5,1000,30);
Period2:=Input("Cycle Period 2",5,1000,80);
Period3:=Input("Cycle Period 3",5,1000,130);
Period4:=Input("Cycle Period 4",5,1000,180);
Period5:=Input("Cycle Period 5",5,1000,300);
Period6:=Input("Cycle Period 6",5,1000,800);
B:=LastValue(Cum(1));
Prd:=Period1;
A:=Cum(1)*360/Prd;
F:=2*Sum(C*Cos(A),B)/B;
G:=2*Sum(C*Sin(A),B)/B;
J:=LastValue(Sqrt(Power(G,2)+Power(F,2)));
K:=LastValue(Atan(G,F)*57.29577951);
W1:=LastValue(Mov(C,B,S))+J*Cos(A-K);
Prd:=Period2;
A:=Cum(1)*360/Prd;
F:=2*Sum(C*Cos(A),B)/B;
G:=2*Sum(C*Sin(A),B)/B;
J:=LastValue(Sqrt(Power(G,2)+Power(F,2)));
K:=LastValue(Atan(G,F)*57.29577951);
W2:=LastValue(Mov(C,B,S))+J*Cos(A-K);
Prd:=Period3;
A:=Cum(1)*360/Prd;
F:=2*Sum(C*Cos(A),B)/B;
G:=2*Sum(C*Sin(A),B)/B;
J:=LastValue(Sqrt(Power(G,2)+Power(F,2)));
K:=LastValue(Atan(G,F)*57.29577951);
W3:=LastValue(Mov(C,B,S))+J*Cos(A-K);
Prd:=Period4;
A:=Cum(1)*360/Prd;
F:=2*Sum(C*Cos(A),B)/B;
G:=2*Sum(C*Sin(A),B)/B;
J:=LastValue(Sqrt(Power(G,2)+Power(F,2)));
K:=LastValue(Atan(G,F)*57.29577951);
W4:=LastValue(Mov(C,B,S))+J*Cos(A-K);
Prd:=Period5;
A:=Cum(1)*360/Prd;
F:=2*Sum(C*Cos(A),B)/B;
G:=2*Sum(C*Sin(A),B)/B;
J:=LastValue(Sqrt(Power(G,2)+Power(F,2)));
K:=LastValue(Atan(G,F)*57.29577951);
W5:=LastValue(Mov(C,B,S))+J*Cos(A-K);
Prd:=Period6;
A:=Cum(1)*360/Prd;
F:=2*Sum(C*Cos(A),B)/B;
G:=2*Sum(C*Sin(A),B)/B;
J:=LastValue(Sqrt(Power(G,2)+Power(F,2)));
K:=LastValue(Atan(G,F)*57.29577951);
W6:=LastValue(Mov(C,B,S))+J*Cos(A-K);
W1+W2+W3+W4+W5+W6
wabbit [:D]
|