/v1/collision
1D two-body collision
Essayez-le en direct
10 appels gratuits par jour — sans inscription, sans clé API. Passe par la passerelle oanor.
Ça marche. Récupérez une clé API et utilisez-la dans votre projet.
Obtenez une clé APIExtraits de code
curl "https://api.oanor.com/momentum-api/v1/collision" \ -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/momentum-api/v1/collision", {
headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/momentum-api/v1/collision");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
"https://api.oanor.com/momentum-api/v1/collision",
headers={"x-oanor-key": "oanor_test_..."}
)
Exemple de réponse
Une réponse réelle de ce endpoint, capturée lors du dernier contrôle de santé.
{
"data": {
"formula": "momentum is conserved; v' from restitution e (1 elastic, 0 inelastic).",
"mass1_kg": 2,
"mass2_kg": 1,
"restitution": 1,
"collision_type": "perfectly elastic",
"velocity1_final_ms": 0.333333,
"velocity2_final_ms": 4.333333,
"total_momentum_kg_ms": 5,
"velocity1_initial_ms": 3,
"velocity2_initial_ms": -1,
"kinetic_energy_lost_j": 0,
"kinetic_energy_after_j": 9.5,
"kinetic_energy_before_j": 9.5
},
"meta": {
"timestamp": "2026-06-04T10:18:44.907Z",
"request_id": "2a2c600b-a66d-4cc6-960e-664797f615d7"
},
"status": "ok",
"message": "1D two-body collision",
"success": true
}