Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ISC_123 - Travail Pratique 001 - Simulation Système Planétaire
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
florian.burgener
ISC_123 - Travail Pratique 001 - Simulation Système Planétaire
Commits
ad501ed7
Commit
ad501ed7
authored
3 years ago
by
florian.burgener
Browse files
Options
Downloads
Patches
Plain Diff
Update README
parent
85339a8e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+0
-77
0 additions, 77 deletions
README.md
with
0 additions
and
77 deletions
README.md
+
0
−
77
View file @
ad501ed7
...
@@ -25,89 +25,12 @@ Afin de mener ce projet à terme, nous avons dû créer certaines de nos structu
...
@@ -25,89 +25,12 @@ Afin de mener ce projet à terme, nous avons dû créer certaines de nos structu
| Terre | 5.9722
* 1E24 | 0.0167 | 149.596 *
1E9 |
| Terre | 5.9722
* 1E24 | 0.0167 | 149.596 *
1E9 |
| Mars | 0.64169
* 1E24 | 0.0935 | 227.923 *
1E9 |
| Mars | 0.64169
* 1E24 | 0.0935 | 227.923 *
1E9 |
*
https://nssdc.gsfc.nasa.gov/planetary/factsheet/sunfact.html
*
https://nssdc.gsfc.nasa.gov/planetary/factsheet/sunfact.html
*
https://nssdc.gsfc.nasa.gov/planetary/factsheet/mercuryfact.html
*
https://nssdc.gsfc.nasa.gov/planetary/factsheet/mercuryfact.html
*
https://nssdc.gsfc.nasa.gov/planetary/factsheet/venusfact.html
*
https://nssdc.gsfc.nasa.gov/planetary/factsheet/venusfact.html
*
https://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html
*
https://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html
*
https://nssdc.gsfc.nasa.gov/planetary/factsheet/marsfact.html
*
https://nssdc.gsfc.nasa.gov/planetary/factsheet/marsfact.html
### Structures
#### CelestialObject
Représente un corps céleste comme par exmple : une planète ou une étoile.
```
c
typedef
struct
CelestialObject
{
char
name
[
100
];
double
mass
;
Vector2
previous_position
;
Vector2
position
;
double
semi_major_axis
;
double
eccentricity
;
int32_t
drawing_disc_radius
;
int32_t
drawing_color
;
Vector2
*
previous_positions
;
int32_t
previous_positions_length
;
}
CelestialObject
;
CelestialObject
*
celestial_object_create
(
char
*
name
,
double
mass
,
double
semi_major_axis
,
double
eccentricity
,
int32_t
drawing_disc_radius
,
int32_t
drawing_color
);
void
celestial_object_destroy
(
CelestialObject
*
object
);
int32_t
get_zoomed_drawing_disc_radius
(
CelestialObject
*
object
,
double
zoom_factor
);
Vector2
calculate_gravitational_acceleration
(
int32_t
object_index
,
CelestialObject
**
objects
,
int32_t
objects_length
);
void
celestial_object_first_update
(
int32_t
object_index
,
CelestialObject
**
objects
,
int32_t
objects_length
,
int32_t
main_object_index
);
void
celestial_object_update
(
int32_t
object_index
,
CelestialObject
**
objects
,
int32_t
objects_length
,
double
interval
,
double
previous_interval
);
void
celestial_object_update_previous_positions
(
CelestialObject
*
object
);
void
celestial_object_draw
(
CelestialObject
*
object
,
Vector2
reference_frame
,
double
zoom_factor
);
void
celestial_object_draw_name
(
CelestialObject
*
object
,
Vector2
reference_frame
,
double
zoom_factor
);
```
#### PlanetarySystem
Représente un système planétaire composé d'une étoile en son centre et des planètes orbitant autour.
```
c
typedef
struct
PlanetarySystem
{
CelestialObject
**
objects
;
int32_t
objects_length
;
int32_t
reference_frame_index
;
double
zoom_factor
;
double
previous_interval
;
bool
show_names
;
}
PlanetarySystem
;
PlanetarySystem
*
planetary_system_create
();
void
planetary_system_destroy
(
PlanetarySystem
*
planetary_system
);
Vector2
planetary_system_get_reference_frame
(
PlanetarySystem
*
planetary_system
);
void
planetary_system_update
(
PlanetarySystem
*
planetary_system
,
double
interval
);
void
planetary_system_draw
(
PlanetarySystem
*
planetary_system
);
void
planetary_system_draw_object_names
(
PlanetarySystem
*
planetary_system
);
```
#### Vector2
Représente un vecteur en 2 dimensions.
```
c
typedef
struct
Vector2
{
double
x
;
double
y
;
}
Vector2
;
Vector2
vector2_create
(
double
x
,
double
y
);
Vector2
vector2_create_zero
();
Vector2
vector2_add
(
Vector2
a
,
Vector2
b
);
Vector2
vector2_substract
(
Vector2
a
,
Vector2
b
);
Vector2
vector2_multiply
(
Vector2
v
,
double
scalar
);
double
vector2_dot_product
(
Vector2
a
,
Vector2
b
);
double
vector2_norm_sqr
(
Vector2
v
);
double
vector2_norm
(
Vector2
v
);
Vector2
vector2_normalize
(
Vector2
v
);
Vector2
vector2_fit_canvas
(
Vector2
v
,
int32_t
width
,
int32_t
height
);
void
vector2_print
(
Vector2
v
);
```
### Fonctionnement
### Fonctionnement
#### Système de mise à jour
#### Système de mise à jour
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment