/
talehunter
/
ballistics
Обзор
Документация
Войти
/
talehunter
/
ballistics
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
mathematic.py
60 строк
1 KB
talehunter
autoformat
24 ноя 2025, 10:53
24 ноя 2025, 10:53
924c8ec
Код
Авторство
О чём код?
import numpy as np from consts import RSE, RSJ, MSUN, ME import configparser config = configparser.ConfigParser() config.read("config.ini") Ra2 = float(config["Data"]["Ra2"]) Ve = float(config["Data"]["Ve"]) R = float(config["Data"]["R"]) # Определение функций def e1(theta1): return (Ra2 - RSE) / (RSE * np.cos(theta1) + Ra2) def e2(theta2): return (RSJ - RSE) / (RSE * np.cos(theta2) + RSJ) def p1(theta1): return Ra2 * (1 - e1(theta1)) def p2(theta2): return RSJ * (1 - e2(theta2)) def vr1(theta1): return np.sqrt(MSUN / p1(theta1)) * e1(theta1) * np.sin(theta1) def vn1(theta1): return np.sqrt(MSUN / p1(theta1)) * (1 + e1(theta1) * np.cos(theta1)) def vr2(theta2): return np.sqrt(MSUN / p2(theta2)) * e2(theta2) * np.sin(theta2) def vn2(theta2): return np.sqrt(MSUN / p2(theta2)) * (1 + e2(theta2) * np.cos(theta2)) def v_001(theta1): return np.sqrt(vr1(theta1) ** 2 + (vn1(theta1) - Ve) ** 2) def v_002(theta2): return np.sqrt(vr2(theta2) ** 2 + (vn2(theta2) - Ve) ** 2) def alpha1(theta1, theta2): numerator = vr1(theta1) * vr2(theta2) + (vn1(theta1) - Ve) * (vn2(theta2) - Ve) denominator = v_001(theta1) * v_002(theta2) return np.arccos(numerator / denominator) def alpha2(theta1): return 2 * np.arcsin(1 / (1 + (R * v_001(theta1) ** 2) / ME))