#######################################################################################################################################
# #
# D I S P O S I T I O N " H A R M O N I E U S E " D E P O I N T S S U R U N E S P H E R E #
# A V E C V I S U A L I S A T I O N D E L A S P H E R E : #
# #
# #
# Author of '$xiirs/.PSPH.21.2.2.$U' : #
# #
# Jean-Francois Colonna (LACTAMME, 20030401115329). #
# #
#######################################################################################################################################
$c #include <stdio.h>
$c
$c #define RAYON _____Rayon
$c
$c #define PI 3.141592653589793
$c
$c #define PARITE 2
$c
$c #define Ntheta (16*PARITE)
$c #define theta0 0.0
$c #define thetaN (2*PI)
$c /* Le 'theta' est le 'v' de 'v $xrs/sphere.11$K'. */
$c #define Ptheta ((thetaN-theta0)/Ntheta)
$c #define DPtheta 20
$c /* Diviseur du pas 'Ptheta'. */
$c #define PEtheta (Ptheta/DPtheta)
$c #define Etheta 20
$c /* Echantillonnage de 'theta'. */
$c
$c #define Nphi (8*PARITE)
$c #define phi0 (-PI/2)
$c #define phiN (+PI/2)
$c /* Le 'phi' est le 'u' de 'v $xrs/sphere.11$K'. */
$c #define Pphi ((phiN-phi0)/Nphi)
$c #define DPphi 20
$c /* Diviseur du pas 'Pphi'. */
$c #define PEphi (Pphi/DPphi)
$c #define Ephi 20
$c /* Echantillonnage de 'phi'. */
$c
$c extern double cos();
$c extern double sin();
$c
$c int main()
$c {
$c double theta,phi;
$c
$c int ECtheta=0;
$c /* Echantillonnage courant de 'theta'. */
$c
$c for (theta=theta0 ;
$c theta<=thetaN ;
$c theta=theta+PEtheta
$c )
$c {
$c int ECphi=0;
$c /* Echantillonnage courant de 'phi'. */
$c
$c for (phi=phi0 ;
$c phi<=phiN ;
$c phi=phi+PEphi
$c )
$c {
$c int n;
$c for (n=1 ; n<=2 ; n++)
$c /* En effet, il faut "faire deux tours" a cause de l'option "isoles=FAUX" ci-apres dans */
$c /* '$xrv/particule.10$X'... */
$c {
$c if (((ECtheta % Etheta) == 0) || ((ECphi % Ephi) == 0))
$c {
$c printf("echo %f >>! $xTV/COORDONNEES$COORD_X\n"
$c ,RAYON*cos(theta)*cos(phi)
$c );
$c printf("echo %f >>! $xTV/COORDONNEES$COORD_Y\n"
$c ,RAYON*sin(phi)
$c );
$c printf("echo %f >>! $xTV/COORDONNEES$COORD_Z\n"
$c ,RAYON*sin(theta)*cos(phi)
$c );
$c /* On notera que l'on utilise ici : */
$c /* */
$c /* X(phi,theta) = r.cos(theta).cos(phi) */
$c /* Y(phi,theta) = r.sin(phi) */
$c /* Z(phi,theta) = r.sin(theta).cos(phi) */
$c /* */
$c /* phi E [-PI/2,+PI/2] */
$c /* theta E [0,2.PI] */
$c /* */
$c /* ('phi' est la latitude et 'theta', la longitude) */
$c /* alors que 'v $xrs/sphere.11$K' utilise (avec */
$c /* u~phi et v~theta) : */
$c /* */
$c /* X(u,v) = r.sin(u).cos(v) */
$c /* Y(u,v) = r.sin(u).sin(v) */
$c /* Z(u,v) = r.cos(u) */
$c /* */
$c /* u E [0,PI] */
$c /* v E [0,2.PI] */
$c /* */
$c
$c printf("echo $_____RayonS >>! $xTV/RAYONS\n");
$c
$c printf("echo $_____CouleurSR >>! $xTV/COULEURS$ROUGE\n");
$c printf("echo $_____CouleurSV >>! $xTV/COULEURS$VERTE\n");
$c printf("echo $_____CouleurSB >>! $xTV/COULEURS$BLEUE\n");
$c }
$c else
$c {
$c }
$c }
$c ECphi++;
$c }
$c ECtheta++;
$c }
$c }