Center of Mass API
Centre-of-mass and barycentre mechanics as an API, computed locally and deterministically. The point-masses endpoint computes the centre of mass of a system of point masses in one, two or three dimensions, applying x_com = Σ(m_i·x_i)/Σm_i to each axis from a list of masses and their x (and optional y and z) coordinates — masses of 1, 2 and 3 at positions 0, 1 and 2 give a centre of mass at 1.333, and four equal masses at the corners of a square sit at its centre. The two-body endpoint computes the barycentre of two masses separated by a distance, r1 = d·m2/(m1+m2) from the first body, which always lies closer to the heavier one — for the Earth-Moon system the barycentre is about 4 670 km from Earth’s centre, still inside the planet. Lists may be passed as comma-separated values (masses=1,2,3&x=0,1,2) or as JSON arrays in a POST body, and units are consistent and unit-agnostic. Everything is computed locally and deterministically, so it is instant and private. Ideal for physics, engineering-statics, astronomy, robotics, game-physics and mechanics-education app developers, balance-point and barycentre tools, and simulation software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 2 endpoints. This is the centre of mass; for the rotational moment of inertia use a moment-of-inertia API.
api.oanor.com/centerofmass-api