minor corrections
This commit is contained in:
parent
2f2503b876
commit
78b94bc0a3
@ -1,8 +1,8 @@
|
|||||||
-- TODO defined globals need to be created somewhere else
|
-- 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 = {
|
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
|
parameters.absolute_magnitude = 35.4631241560502 * math.exp(-0.000353006569939 * parameters.temperature) -- Mv
|
||||||
|
@ -20,10 +20,11 @@ world = tiny.world game, unpack systems
|
|||||||
|
|
||||||
system = ->
|
system = ->
|
||||||
sun = makeEntity {
|
sun = makeEntity {
|
||||||
x: 0,
|
x: 0, y: 0
|
||||||
y: 0
|
radius: 5
|
||||||
}
|
}
|
||||||
planet = makeEntity {
|
planet = makeEntity {
|
||||||
|
radius: 1
|
||||||
orbit: {
|
orbit: {
|
||||||
hierarchy: 1
|
hierarchy: 1
|
||||||
radius: 20
|
radius: 20
|
||||||
|
@ -20,14 +20,14 @@ MapDisplay = tiny.sortedSystem {
|
|||||||
orbit = entity.orbit
|
orbit = entity.orbit
|
||||||
-- orbital period
|
-- orbital period
|
||||||
-- real: T = 2pi * sqrt(a^3 / G*M)
|
-- real: T = 2pi * sqrt(a^3 / G*M)
|
||||||
-- sim: T = 2pi * speed_parameter
|
-- sim: T = 2pi / speed_parameter
|
||||||
entity.x = orbit.radius * cos(t / orbit.speed_parameter) + orbit.offset
|
entity.x = orbit.radius * cos(t * orbit.speed_parameter) + orbit.offset
|
||||||
entity.y = orbit.radius * sin(t / orbit.speed_parameter) + orbit.offset
|
entity.y = orbit.radius * sin(t * orbit.speed_parameter) + orbit.offset
|
||||||
if orbit.parent_id
|
if orbit.parent_id
|
||||||
parent = IDTracker[orbit.parent_id]
|
parent = IDTracker[orbit.parent_id]
|
||||||
entity.x += parent.x
|
entity.x += parent.x
|
||||||
entity.y += parent.y
|
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
|
return MapDisplay
|
||||||
|
Loading…
Reference in New Issue
Block a user