1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| void display3DCharArray( char ***ptr, size_t x, size_t y )
{
size_t i,j;
for ( i=0 ; i<x ; i++ )
for ( j=0 ; j<y ; j++ )
{
printf("%s", ptr[i][j]);
}
}
void display2DFloatPtr( float **ptr, size_t line, size_t row )
{
size_t i,j;
for ( i=0 ; i<line ; i++ )
for( j=0 ; j<row ; j++ )
{
printf("%f ", ptr[i][j]);
}
}
void displayCoordinates( t_sphere *sphere, char typeCoord )
{
size_t i;
if ( typeCoord == 's' )
{
printf("\n --------Node's spherical coordinates--------\n");
for ( i=0 ; i<sphere->nodeNumber ; i++ )
{
printf("\n + node %d", i);
printf("\n | teta = %f", sphere->sphericalCoordinate[i].teta);
printf("\n | phi = %f", sphere->sphericalCoordinate[i].phi );
}
}
if ( typeCoord == 'c' )
{
printf("\n --------Node's cartesian coordinates--------\n");
for ( i=0 ; i<sphere->nodeNumber ; i++ )
{
printf("\n + node %d", i);
printf("\n | x = %f", sphere->cartesianCoordinate[i].x);
printf("\n | y = %f", sphere->cartesianCoordinate[i].y );
printf("\n | z = %f", sphere->cartesianCoordinate[i].z );
}
}
} |
Partager