plot_system_3d: Plot 3D Interactive System Snapshot at a Single Time

View source: R/plot_data.R

plot_system_3dR Documentation

Plot 3D Interactive System Snapshot at a Single Time

Description

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.

Usage

plot_system_3d(sim_data, time = NULL, trails = FALSE)

Arguments

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.

Value

A 'plotly' HTML widget.

Examples


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()


orbitr documentation built on Oct. 2, 2026, 1:06 a.m.