agent updates

This commit is contained in:
znetsixe
2026-02-12 10:14:56 +01:00
parent 105a3082ab
commit 1cfb36f604
22 changed files with 649 additions and 23 deletions

21
test/gravity.test.js Normal file
View File

@@ -0,0 +1,21 @@
const test = require('node:test');
const assert = require('node:assert/strict');
const gravity = require('../src/helper/gravity.js');
test('standard gravity constant is available', () => {
assert.ok(Math.abs(gravity.getStandardGravity() - 9.80665) < 1e-9);
});
test('local gravity decreases with elevation', () => {
const seaLevel = gravity.getLocalGravity(45, 0);
const high = gravity.getLocalGravity(45, 1000);
assert.ok(high < seaLevel);
});
test('pressureHead and weightForce use local gravity', () => {
const dp = gravity.pressureHead(1000, 5, 45, 0);
const force = gravity.weightForce(2, 45, 0);
assert.ok(dp > 0);
assert.ok(force > 0);
});