Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Algo_cours
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
Show more breadcrumbs
gabriel.marinoja
Algo_cours
Commits
5610db20
Verified
Commit
5610db20
authored
3 years ago
by
orestis.malaspin
Browse files
Options
Downloads
Patches
Plain Diff
updated last slide
parent
71fcdfde
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
slides/cours_21.md
+8
-20
8 additions, 20 deletions
slides/cours_21.md
with
8 additions
and
20 deletions
slides/cours_21.md
+
8
−
20
View file @
5610db20
...
@@ -813,26 +813,14 @@ Pour calculer la force sur un corps `c`, on parcourt l'arbre en commençant par
...
@@ -813,26 +813,14 @@ Pour calculer la force sur un corps `c`, on parcourt l'arbre en commençant par
```
C
```
C
rien maj_force_sur_etoile(arbre, e, theta)
rien maj_force_sur_etoile(arbre, e, theta)
si est_vide(arbre)
ou !existe(e)
si est_vide(arbre)
retourne
retourne
if (!n || !p) {
return;
}
// if the node is a leaf and contains a particle which and the particle is not
si est_feuille(arbre) && contient_etoile(n) && dans_le_quadrant(arbre.q, e.x)
// in the bounding box of the node (this means that we are at a particle on
maj_force(e, arbre.e)
// a different leaf).
sinon si noed_assez_loin(arbre, e, theta)
if (node_is_leaf(n) && !node_is_empty(n) && !is_inside(n->b, p->pos)) {
maj_force(e, arbre.sup_etoile)
update_acceleration(p, n->p);
sinon
}
pour enfant dans enfants
// else if the node is far enough of the particle
maj_force_sur_etoile(enfant, e, theta)
else if (node_is_far_enough(n, p, theta)) {
update_acceleration(p, n->super_p);
}
else { // else just update the acceleration recurively
for (int i = 0; i < 4; ++i) {
update_acceleration_from_node_on_particle(n->children[i], p, theta);
}
}
}
```
```
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