Skip to content

Commit

Permalink
orbitalkiller: minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Borunov committed Jun 20, 2016
1 parent a4c3ba6 commit 75f6e41
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
Expand Up @@ -126,13 +126,13 @@ object OrbitDataUpdater {
drawSlidingLines(yy, orbit_color)
}

drawLine(new_o.f*scale, new_o.center*scale, GRAY)
/*drawLine(new_o.f*scale, new_o.center*scale, GRAY)
if(_stop_after_number_of_tacts > 0) {
val p = new_o.orbitalPointAfterTime(bs.coord, (_stop_after_number_of_tacts * base_dt * 1000).toLong, ccw)
drawLine(p*scale, (p + (new_o.center - new_o.f).perpendicular*math.signum(p*(new_o.center - new_o.f)))*scale, GRAY)
val p2 = new_o.orbitalPointByTrueAnomalyRad(_stop_in_orbit_true_anomaly)
drawLine(p2*scale, (p2 + (new_o.center - new_o.f).perpendicular*math.signum(p*(new_o.center - new_o.f)))*scale, GRAY)
}
}*/


if(InterfaceHolder.namesSwitcher.showNames) {
Expand Down
Expand Up @@ -263,8 +263,8 @@ object OrbitalKiller extends ScageScreenAppDMT("Orbital Killer", property("scree
//val ship_init_velocity = speedToHaveOrbitWithParams(ship_start_position, -30000, earth.coord, earth.linearVelocity, earth.mass, G)

// на круговой орбите в 200 км от поверхности Земли
val ship_start_position = earth.coord + DVec(-100, earth.radius + 199000)
val ship_init_velocity = satelliteSpeed(ship_start_position, earth.coord, earth.linearVelocity, earth.mass, G, counterclockwise = true).n*18760/** 1.15 */
//val ship_start_position = earth.coord + DVec(-100, earth.radius + 199000)
//val ship_init_velocity = satelliteSpeed(ship_start_position, earth.coord, earth.linearVelocity, earth.mass, G, counterclockwise = true).n*18760/** 1.15 */

//val ship_start_position = earth.coord + DVec(-100, earth.radius + 198000)
//val ship_init_velocity = speedToHaveOrbitWithParams(ship_start_position, 900000, earth.coord, earth.linearVelocity, earth.mass, G, ccw = false)
Expand All @@ -278,14 +278,22 @@ object OrbitalKiller extends ScageScreenAppDMT("Orbital Killer", property("scree
//val ship_init_velocity = -escapeVelocity(ship_start_position, earth.coord, earth.linearVelocity, earth.mass, G, counterclockwise = true)*1.01

// на орбите в 1000 км от поверхности Луны
//val ship_start_position = moon.coord + DVec(0, moon.radius + 100000)
//val ship_init_velocity = speedToHaveOrbitWithParams(ship_start_position, 900000, moon.coord, moon.linearVelocity, moon.mass, G, ccw = false)//satelliteSpeed(ship_start_position, moon.coord, moon.linearVelocity, moon.mass, G, counterclockwise = false)
val ship_start_position = moon.coord + DVec(0, moon.radius + 100000)
val ship_init_velocity = speedToHaveOrbitWithParams(ship_start_position, 900000, moon.coord, moon.linearVelocity, moon.mass, G, ccw = true)//satelliteSpeed(ship_start_position, moon.coord, moon.linearVelocity, moon.mass, G, counterclockwise = false)
//val ship_init_velocity = satelliteSpeed(ship_start_position, earth.coord, earth.linearVelocity, earth.mass, G, counterclockwise = true)*1.15

// на гиперболической орбите Земли, приближаемся к перицентру, летим по часовой стрелке
//val ship_start_position = DVec(-6.2797933836710215E7, -1.2455588349688923E8) + earth.coord
//val ship_init_velocity = DVec(30521.418357148767,2855.1265848825283)

// на гиперболической орбите Земли, приближаемся к перицентру, летим против часовой стрелки
//val ship_start_position = DVec(9.594617648145294E7, -8.919468846308415E7) + earth.coord
//val ship_init_velocity = DVec(28167.17922375556,2692.468259455251)

val player_ship = new Ship4(ScageId.nextId,
init_coord = DVec(9.594617648145294E7, -8.919468846308415E7)+earth.coord,//DVec(-6.2797933836710215E7, -1.2455588349688923E8)+earth.coord,//ship_start_position,
init_velocity = DVec(28167.17922375556,2692.468259455251),//DVec(30521.418357148767,2855.1265848825283),//ship_init_velocity,
init_rotation = 214.7977970092611//164.6850289440855//90
init_coord = ship_start_position,
init_velocity = ship_init_velocity,
init_rotation = 90
)

// на круговой орбите в 200 км от поверхности Земли
Expand Down
Expand Up @@ -10,10 +10,10 @@ class PlanetsInfluenceInfo extends InterfaceElement {
val sun_force = gravityForce(sun.coord, sun.mass, player_ship.coord, player_ship.mass, G).norma
val earth_force = gravityForce(earth.coord, earth.mass, player_ship.coord, player_ship.mass, G).norma
val moon_force = gravityForce(moon.coord, moon.mass, player_ship.coord, player_ship.mass, G).norma
val all = sun_force + earth_force + moon_force
val sun_influence_str = f"${sun.name} ${sun_force / all * 100}%.2f%%"
val earth_influence_str = f"${earth.name} ${earth_force / all * 100}%.2f%%"
val moon_influence_str = f"${moon.name} ${moon_force / all * 100}%.2f%%"
val sum_force = sun_force + earth_force + moon_force
val sun_influence_str = f"${sun.name} ${sun_force / sum_force * 100}%.2f%%"
val earth_influence_str = f"${earth.name} ${earth_force / sum_force * 100}%.2f%%"
val moon_influence_str = f"${moon.name} ${moon_force / sum_force * 100}%.2f%%"
strings(0) = f"Влияние небесных тел $sun_influence_str $earth_influence_str $moon_influence_str"
}

Expand Down

0 comments on commit 75f6e41

Please sign in to comment.