diff options
| author | victor | 2026-10-24 15:57:01 +0200 |
|---|---|---|
| committer | victor | 2026-10-24 15:57:01 +0200 |
| commit | 4533910bce394e7a0ee6debfc05ca1221ee51899 (patch) | |
| tree | 73aaa5b2c7a48dbf226e6b81d499ba1a8ecc33a1 /src/physics/electricField.test.ts | |
| parent | Tilføj dansk (diff) | |
| download | 3D-Electrophysics-4533910bce394e7a0ee6debfc05ca1221ee51899.tar.gz 3D-Electrophysics-4533910bce394e7a0ee6debfc05ca1221ee51899.zip | |
Astra!ny-start
Diffstat (limited to 'src/physics/electricField.test.ts')
| -rw-r--r-- | src/physics/electricField.test.ts | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/physics/electricField.test.ts b/src/physics/electricField.test.ts deleted file mode 100644 index 2e01309..0000000 --- a/src/physics/electricField.test.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { describe, expect, it } from 'vitest'; -import { electricField, COULOMB_CONSTANT } from './electricField'; - -describe('Coulomb electric field', () => { - it('points away from a positive charge with inverse-square magnitude', () => { - const field = electricField({ x: 2, y: 0, z: 0 }, [{ x: 0, y: 0, z: 0, coulombs: 1e-9 }]); - expect(field.x).toBeCloseTo(COULOMB_CONSTANT * 1e-9 / 4); - expect(field.y).toBe(0); - expect(field.z).toBe(0); - }); - it('superposes opposite charges in the same direction at the midpoint', () => { - const field = electricField({ x: 0, y: 0, z: 0 }, [ - { x: -1, y: 0, z: 0, coulombs: 1e-9 }, - { x: 1, y: 0, z: 0, coulombs: -1e-9 }, - ]); - expect(field.x).toBeCloseTo(2 * COULOMB_CONSTANT * 1e-9); - }); - it('omits singular samples within the visualization exclusion radius', () => { - expect(electricField({ x: 0, y: 0, z: 0 }, [{ x: 0, y: 0, z: 0, coulombs: 1e-9 }])).toEqual({ x: 0, y: 0, z: 0 }); - }); -}); |