| plot_system_3d | R Documentation |
The 3D counterpart to [plot_system()]. Draws every body's position at a chosen time as a sphere in an interactive plotly scene, optionally with the full orbital trajectories shown faintly behind.
plot_system_3d(sim_data, time = NULL, trails = FALSE)
sim_data |
A tibble output from [simulate_system()]. |
time |
Time (in simulation seconds) to snapshot. Defaults to the last time step. Snaps to the closest available time in the data. |
trails |
Logical. If 'TRUE' (the default), the full orbit paths are drawn faintly behind the snapshot points. |
A 'plotly' HTML widget.
create_system() |>
add_body("Earth", mass = mass_earth) |>
add_body("Moon", mass = mass_moon,
x = distance_earth_moon, vy = speed_moon, vz = 100) |>
simulate_system(time_step = seconds_per_hour, duration = seconds_per_day * 30) |>
plot_system_3d()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.