StelUtils.hpp | StelUtils.hpp | |||
---|---|---|---|---|

skipping to change at line 258 | skipping to change at line 258 | |||

return M_PI_2 - (x + x*x*x * (1.f/6.f + x*x * (3.f/40.f + 5. f/112.f * x*x)) ); | return M_PI_2 - (x + x*x*x * (1.f/6.f + x*x * (3.f/40.f + 5. f/112.f * x*x)) ); | |||

} | } | |||

//! Compute exp(x) for small exponents x | //! Compute exp(x) for small exponents x | |||

inline float fastExp(float x) | inline float fastExp(float x) | |||

{ | { | |||

return (x>=0)? | return (x>=0)? | |||

(1.f + x*(1.f+ x/2.f*(1.f+ x/3.f*(1.f+x/4.f*(1.f+x/5 .f))))): | (1.f + x*(1.f+ x/2.f*(1.f+ x/3.f*(1.f+x/4.f*(1.f+x/5 .f))))): | |||

1.f / (1.f -x*(1.f -x/2.f*(1.f- x/3.f*(1.f-x /4.f*(1.f-x/5.f))))); | 1.f / (1.f -x*(1.f -x/2.f*(1.f- x/3.f*(1.f-x /4.f*(1.f-x/5.f))))); | |||

} | } | |||

//! Get a night mode version of a color. That is find the brightnes | ||||

s of a color and set that in the | ||||

//! red channel only | ||||

inline Vec3f getNightColor(const Vec3f& dayColor) | ||||

{ | ||||

float max = 0.0; | ||||

for(int i=0; i<3; i++) | ||||

{ | ||||

max = dayColor[i] > max ? dayColor[i] : max; | ||||

} | ||||

return Vec3f(max, 0, 0); | ||||

} | ||||

//! Calculate and getting orbital period in days from semi-major axi | ||||

s (in AU) | ||||

double calculateOrbitalPeriod(double SemiMajorAxis); | ||||

} | } | |||

#endif // _STELUTILS_HPP_ | #endif // _STELUTILS_HPP_ | |||

End of changes. 1 change blocks. | ||||

0 lines changed or deleted | | 17 lines changed or added | ||

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |