Function
Create an n-dimensional grid of regularly spaced positions.
Syntax
#include <dx/dx.h>
Array DXMakeGridPositions(int n, int count, int count, int count,...,
float origin, float origin, ..., float delta, float delta, ...)
Array DXMakeGridPositionsV(int n, int *counts, float *origin, float *deltas)
Functional Details
The grids created by these routines are compactly encoded by creating a Product Array of n Regular Arrays and are suitable as "positions" components of a Field. This compact encoding is particularly useful when the data lie in or on a lattice of regularly spaced points, since their positions can be computed, thereby saving the space that explicit indexing would require.
DXMakeGridPositions is used to enter the grid's specifications as individual arguments of the routine's parameters. DXMakeGridPositionsV is used to enter the same arguments as one integer (n) and three Arrays.
The grid constructed by either routine is a Product Array of n terms, each of which is a Regular Array. The first zero-based term describes a line in an n-dimensional space with counts[0] points (starting at the origin), each point separated from the previous point on the line by the n-dimensional vector described by deltas[0] through deltas[n-1]. For each of the remaining n-1 terms, the kth term will have counts[k] points (starting at [0 ... 0]), each of which is separated from the previous point on the line by the n-dimensional vector described by deltas[k*n] through deltas[k*n + (n-1)].
The Array created can be deleted with DXDelete. See 4.2 , "Memory Management".
Return Value
Returns the Array or returns NULL and sets an error code.
See Also
DXMakeGridConnections, DXMakeGridConnectionsV, DXQueryGridConnections, DXQueryGridPositions
"Creating Positions and Connections Grids".