minor corrections

This commit is contained in:
Tangent / Rose / Nebula Rosa 2021-12-21 19:22:54 -05:00
parent 2f2503b876
commit 78b94bc0a3
3 changed files with 9 additions and 8 deletions

View File

@ -1,8 +1,8 @@
-- TODO defined globals need to be created somewhere else
export stefan_boltzmann_constant = 5.670373e-8 -- W / (m^2 * K^4)
export stefan_boltzmann_constant = 5.670374419e-8 -- W / (m^2 * K^4)
parameters = {
temperature = love.math.randomNormal 1000, 6000 -- [2000, 1e4] K
temperature: love.math.randomNormal 1000, 6000 -- [2000 to 10000] K
}
parameters.absolute_magnitude = 35.4631241560502 * math.exp(-0.000353006569939 * parameters.temperature) -- Mv

View File

@ -20,10 +20,11 @@ world = tiny.world game, unpack systems
system = ->
sun = makeEntity {
x: 0,
y: 0
x: 0, y: 0
radius: 5
}
planet = makeEntity {
radius: 1
orbit: {
hierarchy: 1
radius: 20

View File

@ -20,14 +20,14 @@ MapDisplay = tiny.sortedSystem {
orbit = entity.orbit
-- orbital period
-- real: T = 2pi * sqrt(a^3 / G*M)
-- sim: T = 2pi * speed_parameter
entity.x = orbit.radius * cos(t / orbit.speed_parameter) + orbit.offset
entity.y = orbit.radius * sin(t / orbit.speed_parameter) + orbit.offset
-- sim: T = 2pi / speed_parameter
entity.x = orbit.radius * cos(t * orbit.speed_parameter) + orbit.offset
entity.y = orbit.radius * sin(t * orbit.speed_parameter) + orbit.offset
if orbit.parent_id
parent = IDTracker[orbit.parent_id]
entity.x += parent.x
entity.y += parent.y
graphics.circle "fill", entity.x, entity.y, 5 -- TEMP radius
graphics.circle "fill", entity.x, entity.y, entity.radius
}
return MapDisplay