folkarc:orbitalkit
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
folkarc:orbitalkit [2023/10/05 00:06] – [Source] discord | folkarc:orbitalkit [2023/11/03 19:51] (current) – [Source] discord | ||
---|---|---|---|
Line 14: | Line 14: | ||
# Create a planet using "Claim $this is Earth" | # Create a planet using "Claim $this is Earth" | ||
# Create a satellite using "Claim $this is a satellite" | # Create a satellite using "Claim $this is a satellite" | ||
- | + | ||
+ | |||
proc orbitalVelocityAroundEarth {radius} { | proc orbitalVelocityAroundEarth {radius} { | ||
set EarthMass [expr {5.972168 * (10 ** 18)}] | set EarthMass [expr {5.972168 * (10 ** 18)}] | ||
set G [expr {6.67430 * (10.0 ** (-11.0))}] | set G [expr {6.67430 * (10.0 ** (-11.0))}] | ||
+ | |||
return [expr {sqrt(($G * $EarthMass) / $radius)}] | return [expr {sqrt(($G * $EarthMass) / $radius)}] | ||
} | } | ||
- | + | ||
+ | |||
When /someone/ claims / | When /someone/ claims / | ||
When $earth_page has region /earth/ { | When $earth_page has region /earth/ { | ||
# Draw a little earth :> | # Draw a little earth :> | ||
lassign [region centroid $earth] x_earth y_earth | lassign [region centroid $earth] x_earth y_earth | ||
- | Display:: | ||
+ | Wish to draw a circle with x $x_earth y $y_earth radius 100 thickness 5 color green | ||
+ | |||
Wish $earth_page is labelled Earth | Wish $earth_page is labelled Earth | ||
+ | |||
When /someone/ claims /sat_page/ is a satellite | When /someone/ claims /sat_page/ is a satellite | ||
When $sat_page has region /sat/ & the clock time is /t/ & /sat/ has tag /tag/ { | When $sat_page has region /sat/ & the clock time is /t/ & /sat/ has tag /tag/ { | ||
Line 37: | Line 38: | ||
| | ||
# Display the orbit circle | # Display the orbit circle | ||
- | | + | |
set speed [orbitalVelocityAroundEarth [expr {$radius * 1000}]] | set speed [orbitalVelocityAroundEarth [expr {$radius * 1000}]] | ||
Line 47: | Line 48: | ||
# display the stroke | # display the stroke | ||
- | | + | |
+ | |||
+ | Wish to draw a circle with x $x y $y radius 20 thickness 5 color white filled true | ||
- | | + | |
- | Display:: | + | } |
- | } | + | |
} | } | ||
} | } |
folkarc/orbitalkit.1696464387.txt.gz · Last modified: 2023/10/05 00:06 by discord