#include <cstdio>
#include <math.h>
const static float MINIMUM = -3.0f;
const static float MAXIMUM = 3.0f;
const static float STEP = 0.18f;
int main(int argc, char *argv[])
{
try {
af::Window myWindow(1024, 1024,
"2D Vector Field example: ArrayFire");
array dataRange =
seq(MINIMUM, MAXIMUM, STEP);
y.eval();
do {
myWindow(0, 0).
vectorField(points, saddle,
"Saddle point");
myWindow(0, 1).
vectorField(points, hbowl,
"hilly bowl (in a loop with varying amplitude)");
scale -= 0.0010f;
if (scale < -0.01f) {
scale = 2.0f;
}
}
while(!myWindow.
close());
fprintf(stderr,
"%s\n", e.
what());
throw;
}
return 0;
}