MCPcopy Create free account
hub / github.com/arrayfire/forge / julia

Function julia

examples/cpu/fractal.cpp:114–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114int julia(int x, int y, int width, int height)
115{
116 const float scale = 1.5;
117 float jx = scale * (float)(width/2.0f - x)/(width/2.0f);
118 float jy = scale * (float)(height/2.0f - y)/(height/2.0f);
119
120 std::complex<float> c(-0.8f, 0.156f);
121 std::complex<float> a(jx, jy);
122
123 for (int i=0; i<200; i++) {
124 a = a * a + c;
125 if (abs(a) > 1000)
126 return 0;
127 }
128
129 return 1;
130}

Callers 1

kernelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected