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

Function genSurface

examples/cpu/surface.cpp:29–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27const size_t YSIZE = (size_t)((YMAX-YMIN)/DX);
28
29void genSurface(float dx, std::vector<float> &vec )
30{
31 vec.clear();
32 for(float x=XMIN; x < XMAX; x+=dx) {
33 for(float y=YMIN; y < YMAX; y+=dx) {
34 vec.push_back(x);
35 vec.push_back(y);
36 float z = sqrt(x*x+y*y) + 2.2204e-16f;
37 vec.push_back(sin(z)/z);
38 }
39 }
40}
41
42int main(void)
43{

Callers 1

mainFunction · 0.85

Calls 1

clearMethod · 0.80

Tested by

no test coverage detected