I want to make an array, where each element sums up the result of a function"CosineEffect". For example if the "heliostatNumber" is 3, each element in the "Cosine" array should be the sum of three results of funcion"CosineEffect".

But when I print the result out, it seems that they dont add up. Instead each element is the value of just one result, not three results.

```
float Cosine[10];

    for(int i=0;i<11;i++)
    {
        float sum=0;
        for(int j=0; j<heliostatNumber;j++)
        {
            Cosine[i]=sum+CosineEffect(SunRay[i], ReflectedRay[j]);
        }
        cout<<"Cosine Effect = "<<Cosine[i]<<endl;
    }

```