n 체 시뮬레이션1 N체 시뮬레이션 #include #include #include #include #include #include #include "point.h" typedef point Vector; typedef std::vector container; typedef std::vector mass; constexpr double G_const = 6.67430e-11; struct position { const mass &masses; position(const mass &masses) : masses(masses) { } void operator()(const container &p, container &dqdt) const { for (int l = 0; l < p.size(); ++l) { dqdt[l] = p[l] / mas.. 2021. 3. 4. 이전 1 다음