All right:
Code:
#include <stdio.h>
double bluemoon (double x, double y)
{
double function;
double expfunction;
function=-1*x*x;-(1/2)*y*y;
expfunction=exp(function);
return expfunction;
}
main ()
{
double array[200];
int i;
double asta;
for (i = 0; i < 200; i++){
asta=i;
array[i]=asta;
}
double delta_x[100], delta_y[100];
double x[100], y[100], A[100];
for(i=0; i<100; i++){
delta_x[i] = array[i];
delta_y[i] = array[i+100];
}
for (i=0; i<100; i++){
x[i+1]=x[i]+delta_x[i];
y[i+1]=y[i]+delta_y[i];
A[i]=bluemoon(x[i], y[i]);
}
for(i=0; i<100; i++){
printf("%e\n", delta_y[i]);
}
getchar();
return 0;
}
Same problem.
But if I take out the
Code:
for (i=0; i<100; i++){
x[i+1]=x[i]+delta_x[i];
y[i+1]=y[i]+delta_y[i];
A[i]=bluemoon(x[i], y[i]);
}
section it's fine.
EDIT: It also doesn't matter what bluemoon is defined as, still happens. Unfortunately I need that section... lol