o_set_source.c 2.33 KB
Newer Older
Eric Jullo's avatar
Eric Jullo committed
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
#include<stdio.h>
#include<math.h>
#include<fonction.h>
#include<dimension.h>
#include<structure.h>


/****************************************************************/
/*      nom:        o_set_source          */
/*      auteur:     Eric Jullo         */
/*      date:       3/10/2011            */
/*      place:      Marseille            */
/****************************************************************/

void  o_set_source(struct galaxie *source, int ipx, double val)
{

    switch (ipx)
    {
        case(SCX):
            source->C.x = val;
            break;
        case(SCY):
            source->C.y = val;
            break;
        case(SA):
            source->E.a = val;
            break;
29
30
31
        case(SEPS):
            source->eps = val;
            break;
Eric Jullo's avatar
Eric Jullo committed
32
33
34
35
36
37
38
39
40
        case(STHETA):
            source->E.theta = val;
            break;
        case(SINDEX):
            source->var1 = val;
            break;
        case(SFLUX):
            source->mag = val;
            break;
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
        case(SA2):
            source->E2.a = val;
            break;
        case(SEPS2):
            source->eps2 = val;
            break;
        case(STHETA2):
            source->E2.theta = val;
            break;
        case(SINDEX2):
            source->var2 = val;
            break;
        case(SFLUX2):
            source->mag2 = val;
            break;
Eric Jullo's avatar
Eric Jullo committed
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
    }
}

double  o_get_source(struct galaxie *source, int ipx)
{
    double val = 0;

    switch (ipx)
    {
        case(SCX):
            val = source->C.x;
            break;
        case(SCY):
            val = source->C.y;
            break;
        case(SA):
            val = source->E.a;
            break;
74
75
76
        case(SEPS):
            val = source->eps;
            break;            
Eric Jullo's avatar
Eric Jullo committed
77
78
79
80
81
82
83
84
85
        case(STHETA):
            val = source->E.theta;
            break;
        case(SINDEX):
            val = source->var1;
            break;
        case(SFLUX):
            val = source->mag;
            break;
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
        case(SA2):
            val = source->E2.a;
            break;
        case(SEPS2):
            val = source->eps2;
            break;            
        case(STHETA2):
            val = source->E2.theta;
            break;
        case(SINDEX2):
            val = source->var2;
            break;
        case(SFLUX2):
            val = source->mag2;
            break;
Eric Jullo's avatar
Eric Jullo committed
101
102
103
104
    }

    return val;
}