Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96637249
grid.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Dec 29, 08:22
Size
1 KB
Mime Type
text/x-c
Expires
Tue, Dec 31, 08:22 (2 d)
Engine
blob
Format
Raw Data
Handle
23218477
Attached To
R1448 Lenstool-HPC
grid.c
View Options
#include<stdio.h>
#include<math.h>
#include<fonction.h>
#include<constant.h>
#include<dimension.h>
#include<structure.h>
/****************************************************************/
/* nom: grid */
/* auteur: Jean-Paul Kneib */
/* date: 10/02/92 */
/* place: Toulouse
* Initialize the gimage global variable in a rectangular shape.
* gimage is defined with G.ngrid^2 (number in grille section)
* coordinates that map the field of study defined in the champ
* section.
*
***************************************************************/
void grid()
{
const extern struct g_mode M;
const extern struct g_grille G;
const extern struct g_frame F;
extern struct point gimage[NGGMAX][NGGMAX];
double I, J, N;
register int i, j;
NPRINTF(stderr, "SET: Grid XY %dx%d\n", G.ngrid, G.ngrid);
for (i = 0; i < G.ngrid; i++)
for (j = 0; j < G.ngrid; j++)
{
I = i;
J = j;
N = G.ngrid - 1;
I = I / N;
J = J / N;
gimage[i][j].x = F.xmin + I * (F.xmax - F.xmin);
gimage[i][j].y = F.ymin + J * (F.ymax - F.ymin);
};
}
Event Timeline
Log In to Comment