-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObjects.cs
More file actions
138 lines (124 loc) · 5.72 KB
/
Objects.cs
File metadata and controls
138 lines (124 loc) · 5.72 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
namespace Gravity_Simulation
{
public static class Objects
{
public static readonly List<SpaceObject> objects = [];
// Массы небесных тел
public const double SunMass = 1.989e30; // Солнце
public const double EarthMass = 5.972e24; // Земля
public const double MoonMass = 7.347673e22; // Луна
public const double MercuryMass = 3.3011e23; // Меркурий
public const double VenusMass = 4.867e24; // Венера
public const double MarsMass = 6.4171e23; // Марс
public const double JupiterMass = 1.898e27; // Юпитер
public const double SaturnMass = 5.683e26; // Сатурн
public const double UranusMass = 8.681e25; // Уран
public const double NeptuneMass = 1.024e26; // Нептун
// Радиусы небесных тел
public const double SunRadius = 6.957e8; // Радиус Солнца
public const double EarthRadius = 6371e3; // Радиус Земли
public const double MoonRadius = 1737.4e3; // Радиус Луны
public const double MercuryRadius = 2.4397e6; // Радиус Меркурия
public const double VenusRadius = 6051.8e3; // Радиус Венеры
public const double MarsRadius = 3389.5e3; // Радиус Марса
public const double JupiterRadius = 69911e3; // Радиус Юпитера
public const double SaturnRadius = 58232e3; // Радиус Сатурна
public const double UranusRadius = 25362e3; // Радиус Урана
public const double NeptuneRadius = 2.4622e7; // Радиус Нептуна
// Орбитальные дистанции
public const double SunMercuryDistance = 5.791e10; // Расстояние до Меркурия
public const double SunVenusDistance = 1.082e11; // Расстояние до Венеры
public const double EarthSunDistance = 1.496e11; // Расстояние до Земли
public const double SunMarsDistance = 2.2794e11; // Расстояние до Марса
public const double SunJupiterDistance = 7.7833e11; // Расстояние до Юпитера
public const double SunSaturnDistance = 1.4294e12; // Расстояние до Сатурна
public const double SunUranusDistance = 2.87099e12; // Расстояние до Урана
public const double SunNeptuneDistance = 4.504e12; // Расстояние до Нептуна
public const double MoonEarthDistance = 384400e3; // Расстояние до Луны от Земли
// Орбитальные скорости
public const double MercuryOrbitalSpeed = 47870; // Орбитальная скорость Меркурия
public const double VenusOrbitalSpeed = 35020; // Орбитальная скорость Венеры
public const double EarthOrbitalSpeed = 29783; // Орбитальная скорость Земли
public const double MoonOrbitalSpeed = 1022; // Орбитальная скорость Луны
public const double MarsOrbitalSpeed = 24077; // Орбитальная скорость Марса
public const double JupiterOrbitalSpeed = 13070; // Орбитальная скорость Юпитера
public const double SaturnOrbitalSpeed = 9680; // Орбитальная скорость Сатурна
public const double UranusOrbitalSpeed = 6820; // Орбитальная скорость Урана
public const double NeptuneOrbitalSpeed = 5500; // Орбитальная скорость Нептуна
static Objects()
{
objects = [
new SpaceObject(
name: "sun",
pos: new Vector(0, 0),
inertia: new Vector(0, 0),
mass: SunMass,
radius: SunRadius
),
new SpaceObject(
name: "mercury",
pos: new Vector(SunMercuryDistance, 0),
inertia: new Vector(0, MercuryOrbitalSpeed),
mass: MercuryMass,
radius: MercuryRadius
),
new SpaceObject(
name: "venus",
pos: new Vector(SunVenusDistance, 0),
inertia: new Vector(0, VenusOrbitalSpeed),
mass: VenusMass,
radius: VenusRadius
),
new SpaceObject(
name: "earth",
pos: new Vector(EarthSunDistance, 0),
inertia: new Vector(0, EarthOrbitalSpeed),
mass: EarthMass,
radius: EarthRadius
),
new SpaceObject(
name: "moon",
pos: new Vector(EarthSunDistance + MoonEarthDistance, 0),
inertia: new Vector(0, EarthOrbitalSpeed + MoonOrbitalSpeed),
mass: MoonMass,
radius: MoonRadius
),
new SpaceObject(
name: "mars",
pos: new Vector(SunMarsDistance, 0),
inertia: new Vector(0, MarsOrbitalSpeed),
mass: MarsMass,
radius: MarsRadius
),
new SpaceObject(
name: "jupiter",
pos: new Vector(SunJupiterDistance, 0),
inertia: new Vector(0, JupiterOrbitalSpeed),
mass: JupiterMass,
radius: JupiterRadius
),
new SpaceObject(
name: "saturn",
pos: new Vector(SunSaturnDistance, 0),
inertia: new Vector(0, SaturnOrbitalSpeed),
mass: SaturnMass,
radius: SaturnRadius
),
new SpaceObject(
name: "uranus",
pos: new Vector(SunUranusDistance, 0),
inertia: new Vector(0, UranusOrbitalSpeed),
mass: UranusMass,
radius: UranusRadius
),
new SpaceObject(
name: "neptune",
pos: new Vector(SunNeptuneDistance, 0),
inertia: new Vector(0, NeptuneOrbitalSpeed),
mass: NeptuneMass,
radius: NeptuneRadius
),
];
}
}
}