MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / complex_grid

Function complex_grid

examples/graphics/fractal.cpp:22–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20using std::abs;
21
22array complex_grid(int width, int height, float zoom, float center[2]) {
23 // Generate sequences of length width, height
24 array X =
25 (iota(dim4(1, height), dim4(width, 1)) - (float)height / 2.0) / zoom +
26 center[0];
27 array Y =
28 (iota(dim4(width, 1), dim4(1, height)) - (float)width / 2.0) / zoom +
29 center[1];
30
31 // Return the locations as a complex grid
32 return complex(X, Y);
33}
34
35array mandelbrot(const array &in, int iter, float maxval) {
36 array C = in;

Callers 1

mainFunction · 0.85

Calls 2

iotaFunction · 0.50
dim4Class · 0.50

Tested by

no test coverage detected