Changeset 36026
- Timestamp:
- Aug 25, 2013, 12:12:23 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130711/ppSim/src/ppSimMakeGalaxies.c
r35970 r36026 202 202 } 203 203 return true; 204 }205 206 float pmSersicNorm (float index) {207 208 float C0 = NAN;209 float C1 = NAN;210 float C2 = NAN;211 212 // y = 0.201545 x^0 -0.950965 x^1 -0.315248 x^2213 // y = 0.402084 x^0 -1.357775 x^1 -0.105102 x^2214 // y = 0.619093 x^0 -1.591674 x^1 -0.041576 x^2215 // y = 0.770263 x^0 -1.696421 x^1 -0.023363 x^2216 // y = 0.885891 x^0 -1.755684 x^1 -0.015753 x^2217 218 if ((index >= 0.0) && (index < 1.0)) {219 C0 = 0.201545; C1 = -0.950965; C2 = -0.315248;220 // y = 0.201545 x^0 -0.950965 x^1 -0.315248 x^2221 }222 if ((index >= 1.0) && (index < 2.0)) {223 C0 = 0.402084; C1 = -1.357775; C2 = -0.105102;224 // y = 0.402084 x^0 -1.357775 x^1 -0.105102 x^2225 }226 if ((index >= 2.0) && (index < 3.0)) {227 C0 = 0.619093; C1 = -1.591674; C2 = -0.041576;228 // y = 0.619093 x^0 -1.591674 x^1 -0.041576 x^2229 }230 if ((index >= 3.0) && (index < 4.0)) {231 C0 = 0.770263; C1 = -1.696421; C2 = -0.023363;232 // y = 0.770263 x^0 -1.696421 x^1 -0.023363 x^2233 }234 if ((index >= 4.0) && (index < 5.5)) {235 C0 = 0.885891; C1 = -1.755684; C2 = -0.015753;236 // y = 0.885891 x^0 -1.755684 x^1 -0.015753 x^2237 }238 239 if (isnan(C0)) return NAN;240 241 float lnorm = C0 + C1*index + C2*index*index;242 float norm = exp(lnorm);243 return norm;244 204 } 245 205
Note:
See TracChangeset
for help on using the changeset viewer.
