#include <math.h>
#include <cstdio>
const static float MINIMUM = -3.0f;
const static float MAXIMUM = 3.0f;
const static float STEP = 0.18f;
int main(int, char**) {
try {
af::Window myWindow(1024, 1024,
"2D Vector Field example: ArrayFire");
array dataRange =
seq(MINIMUM, MAXIMUM, STEP);
y.eval();
do {
array bvals =
sin(scale * (x * x + y * y));
myWindow(0, 0).
vectorField(points, saddle,
"Saddle point");
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;
}