Plotting Functions

Spheres and Axes

from axinite import axtools

radius = 2
pos = [0, 0, 0]
sphere_points = axtools.create_sphere(pos, radius) # generates points on the sphere
if axtools.sphere_has([2, 0, 0]): print("Sphere includes point [2, 0, 0]!")

limit = 100
delta = 1
body1 = axtools.Body("body1", 1, limit, delta, position=[0, 0, 0], radius=2)
body2 = axtools.Body("body2", 2, limit, delta, position=[2, 2, 2], radius=2)

max_axis_length = axtools.max_axis_length(body1, body2) # returns the furthest distance in a positive direction
min_axis_length = axtools.min_axis_length(body1, body2) # returns the furthest distance in a negative direction

Other Functions

from axinite import axtools
import json

data = """
{
    "name": "Earth",
    "mass": 5.972e24,
    "radius": 6.371e6,
    "color": "green",
    "r": [[0, 0, 0]],
    "v": [[0, 0, 0]]
}
"""

limit = 100
delta = 1

body = axtools.data_to_body(json.loads(data), limit, delta)
body2 = ax.Body("body2", 2, limit, delta, [2, 2, 2], [2, 2, 2])
body2_axtools = axtools.from_body(body2) # ax.Body -> axtools.Body

Last updated