> For the complete documentation index, see [llms.txt](https://jewels86.gitbook.io/axinite/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jewels86.gitbook.io/axinite/api-reference/functions.md).

# Functions

The axinite module's API reference.

All the functions listed on this page can be found in `axinite.functions`. `axinite.functions` also includes a `G` constant.

## `body_dtype`

```python
def body_dtype(limit: np.float64, delta: np.float64) -> np.dtype
```

Returns the data type for a body.

* `limit` (`np.float64`): The length of the simulation in seconds.
* `delta` (`np.float64`): The frequency at which the simulation should be computed in seconds.

Returns:&#x20;

```python
np.dtype([
    ("n", "U20"),
    ("m", np.float64),
    ("r", np.float64, (int(limit/delta), 3)),
    ("v", np.float64, (int(limit/delta), 3))
])
```

## `_body`

```python
def _body(limit: np.float64, delta: np.float64, 
          name: str, mass: np.float64) -> np.ndarray
```

Creates a new body.

* `limit` (`np.float64`): The length of the simulation in seconds.
* `delta` (`np.float64`): The frequency at which the simulation should be computed in seconds.
* `name` (`str`): The name of the body.
* `mass` (`np.float64`): The mass of the body in kilograms.

Returns: A new inner body.

## `get_inner_bodies`

```python
def get_inner_bodies(bodies: list[ax.Body]) -> np.ndarray
```

Returns the inner representations of a list of bodies.

* `bodies` (`list[ax.Body]`): A list of Body objects.

Returns: An array of inner bodies.

## `create_outer_bodies`

```python
def create_outer_bodies(bodies: np.ndarray, limit: np.float64, 
                        delta: np.float64) -> list[ax.Body]
```

Creates outer body representations from inner bodies.

* `bodies` (`np.ndarray`): An array of inner body representations.
* `limit` (`np.float64`): The length of the simulation in seconds.
* `delta` (`np.float64`): The frequency at which the simulation should be computed in seconds.

Returns: A list of body objects.

## `vector_magnitude_jit`

```python
@njit 
def vector_magnitude_jit(vec: np.ndarray) -> float
```

Calculates the magnitude of a vector.

* `vec` (`np.float64`): The vector to calculate the magnitude of.

Returns: The magnitude of the vector.
