libgravix2  0.1.0
A fast simulation of attractive forces acting on point-like particles embedded onto the surface of a sphere.
api.h File Reference

API of libgravix2. More...

#include "libgravix2/libgravix2_export.h"
#include <stdint.h>
Include dependency graph for api.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  GrvxTrajectory
 Sequence of spatial and velocity data of a missile. More...
 
struct  GrvxConfig
 Static configurations. More...
 

Typedefs

typedef struct GrvxPlanetsGrvxPlanetsHandle
 Handle to a set of planets forming a closed universe. More...
 
typedef struct GrvxTrajectoryGrvxTrajectoryBatch
 Handle to a batch of trajectories. More...
 

Functions

GRVX_EXPORT const char * grvx_version (void)
 Returns the version of the library. More...
 
GRVX_EXPORT GrvxPlanetsHandle grvx_new_planets (uint32_t n)
 Creates a new planets handle. More...
 
GRVX_EXPORT void grvx_delete_planets (GrvxPlanetsHandle handle)
 Deletes all planets of the associated handle and frees the allocated memory. More...
 
GRVX_EXPORT uint32_t grvx_count_planets (GrvxPlanetsHandle handle)
 Counts the planets. More...
 
GRVX_EXPORT int32_t grvx_set_planet (GrvxPlanetsHandle handle, uint32_t i, double lat, double lon)
 Initializes or overwrites the spatial position of a planet. More...
 
GRVX_EXPORT int32_t grvx_get_planet (GrvxPlanetsHandle handle, uint32_t i, double *lat, double *lon)
 Retrieves the spatial position of a planet. More...
 
GRVX_EXPORT uint32_t grvx_pop_planet (GrvxPlanetsHandle handle)
 Removes the last planet from the universe. More...
 
GRVX_EXPORT GrvxTrajectoryBatch grvx_new_missiles (uint32_t n)
 Creates a new batch of uninitialized missiles. More...
 
GRVX_EXPORT void grvx_delete_missiles (GrvxTrajectoryBatch batch)
 Deletes a batch of missiles and frees the allocated memory. More...
 
GRVX_EXPORT struct GrvxTrajectorygrvx_get_trajectory (GrvxTrajectoryBatch batch, uint32_t i)
 Extracts a missile by ID from the given missile batch. More...
 
GRVX_EXPORT int32_t grvx_init_missile (struct GrvxTrajectory *trj, double lat, double lon, double v, double dlat, double dlon)
 Initializes the position and velocity of a missile on the sphere. More...
 
GRVX_EXPORT int32_t grvx_launch_missile (struct GrvxTrajectory *trj, GrvxPlanetsHandle planets_handle, uint32_t planet_id, double v_abs, double psi)
 Initializes a missile on the rim of a given planet. More...
 
GRVX_EXPORT uint32_t grvx_propagate_missile (struct GrvxTrajectory *trj, GrvxPlanetsHandle planets, double h, int32_t *premature)
 Propagates a missile in the gravitational force field of planets. More...
 
GRVX_EXPORT double grvx_lat (double z)
 Computes the latitudinal position, \(\phi\), from Cartesian coordinates. More...
 
GRVX_EXPORT double grvx_lon (double x, double y)
 Computes the longitudinal position, \(\lambda\), from Cartesian coordinates. More...
 
GRVX_EXPORT double grvx_vlat (double vx, double vy, double vz, double lat, double lon)
 Computes the latitudinal speed, \(\dot\phi\), from Cartesian coordinates. More...
 
GRVX_EXPORT double grvx_vlon (double vx, double vy, double vz, double lon)
 Computes the (scaled) longitudinal speed, \(\dot\lambda \cos\phi\), from Cartesian coordinates. More...
 
GRVX_EXPORT double grvx_v_esc (void)
 Escape velocity \(p_\pi\) for isolated planets. More...
 
GRVX_EXPORT double grvx_v_scrcl (double r)
 Velocity of a missile on a small circle for isolated planets. More...
 
GRVX_EXPORT double grvx_orb_period (double v0, double h)
 Orbital period for isolated planets. More...
 
GRVX_EXPORT void grvx_perturb_measurement (GrvxPlanetsHandle planets_handle, uint32_t planet_id, double angular_error, double *lat, double *lon)
 Perturbs measurement by assuming finite angular resolution. More...
 
GRVX_EXPORT struct GrvxConfiggrvx_get_config (void)
 Returns static configuration. More...
 
GRVX_EXPORT void grvx_free_config (struct GrvxConfig *cfg)
 Frees GrvxConfig instance. More...
 

Detailed Description

API of libgravix2.

See module API for a detailed description.