We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b1660ed commit 02adecbCopy full SHA for 02adecb
examples/n-body.ua
@@ -3,7 +3,7 @@ Dt ← 0.01
3
Steps ← 120
4
5
Step ← (
6
- ⊞≠.⇡⧻. # Make comparison matrix
+ ⊞≠.°⊏ # Make comparison matrix
7
⊃(≡▽⊙¤)⋅∘ # Make others
8
⊃≡(-¤)∘: # Get diffs
9
÷⍜♭₂(≡/+×.). # Inverse square
@@ -13,12 +13,12 @@ Step ← (
13
)
14
15
[0_60 150_0 30_15 80_110]
16
-⟜(↯:0⊂:2⧻) # Init vels
+⟜(↯⊙0⊂⊙2⧻) # Init vels
17
18
-⁅×0.5⇌[⊙◌⍥(Step ⟜:)Steps] # Run
19
-⍜⊙♭₂-¤/↧♭₂. # Normalize
20
-⬚0≡(°⊚) # Plot
21
-≡(⧈(/↥/↥)3_3) # Upscale
+⁅×0.5 ⍥⤚Step Steps # Run
+⍜⊙♭₂-¤/↧♭₂. # Normalize
+⬚0≡(°⊚) # Plot
+≡(⧈(/↥♭)3_3) # Upscale
22
23
&fwa "n-body.gif" gif 16
24
&p "Wrote gif to n-body.gif"
0 commit comments