From b60ebe7b1f5b0c1eab011bd6a2137322e0c7a838 Mon Sep 17 00:00:00 2001 From: Emile Date: Sat, 16 Feb 2019 19:56:07 +0100 Subject: implemented another test calculating the forces on a star --- db_actions_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'db_actions_test.go') diff --git a/db_actions_test.go b/db_actions_test.go index cb1fefd..230093a 100644 --- a/db_actions_test.go +++ b/db_actions_test.go @@ -107,6 +107,28 @@ func TestCalcAllForces(t *testing.T) { Y: 0, }, }, + { + name: "star in the far top right quadrant", + args: args{ + database: db, + star: structs.Star2D{ + C: structs.Vec2{ + X: 475, + Y: 25, + }, + V: structs.Vec2{ + X: 0, + Y: 0, + }, + M: 1000, + }, + theta: 1.5, + }, + want: structs.Vec2{ + X: -2.945139150499052e-10, + Y: -2.945139150499052e-10, + }, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { -- cgit 1.4.1