Code:
_SECTION_BEGIN("Kalyan_Modification");
a = Param("Angle",30,15,45,1);
a = (22/7) * (a/180);
Num = 0;
Den = 0;
n = Param("Sin_Len",3,1,100,1);
Count = 0;
for (i = 1;i < n+1;i++)
{
if ((n%2 == 0) AND (i == n/2 + 1)) Count = Count;
else
{
if (i <= n/2) Count = Count + 1;
else Count = Count -1;
}
Num = Num + sin(Count*a) * Ref(C,-i-1) ;
Den = Den + sin(Count*a);
}
j1 = Num / Den;
Plot(IIf(j1 > Ref(j1,-1),-10,10),"j1",IIf(j1 > Ref(j1,-1),colorBlueGrey,colorLime), styleThick);
edit: ok understood the prob with even num, will fix it
edit: Done, now check it
Last edited: