Code | Points | Description |
---|---|---|
A1 | 2 | Submission is zip containing nbody folder with python files |
A2 | 2 | Zip is named after uni, unzips to folder with uni-hw4 |
A3 | 3 | Python files have correct names/imports |
A4 | 3 | Python files have good style |
Code | Points | Description |
---|---|---|
B1 | 5 | Code produces a 3 x count list/array of floats |
B2 | 5 | Test case 1 |
B3 | 5 | Test case 2 |
B4 | 5 | Test case 3 |
B5 | 5 | Test case 4 |
B6 | 2 | Function is in the proper file |
B7 | 3 | Good Style (No globals, comments, well named vars) |
Test Cases:
generateObjects(0)
-> []
generateObjects(3)
-> List/array of 3 lists/arrays, first and second between -5 and 5, third between 0 and 100generateObjects(3, 0, 0, 0)
-> [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]
generateObjects(3, 10, 1, 1)
-> 3 lists/arrays of length 3, first and second postiions within 0.5
of 10.0
, third is between 0
and 1
Code | Points | Description |
---|---|---|
C1 | 10 | Code runs and produces correct output for plotObjects(generateObjects(100)) |
C2 | 10 | Code runs and produces correct output for plotObjects(generateObjectsNormal(100)) |
C3 | 5 | Function is in the proper file |
C4 | 5 | Good Style (No globals, comments, well named vars) |
Code | Points | Description |
---|---|---|
D1 | 5 | Code takes two 3x1 lists/arrays and returns two float values or list of length 2 |
D2 | 5 | Test Case 1 |
D3 | 5 | Test Case 2 |
D4 | 5 | Test Case 3 |
D5 | 5 | Test Case 4 |
D6 | 2 | Function is in the proper file |
D7 | 3 | Good Style (No globals, comments, well named vars) |
Note: Small differences are fine due to floating point error
Test Cases:
forceVec([0.0, 0.0, 0.0], [3.0, 4.0, 0.0])
-> 0.0, 0.0
forceVec([0.0, 0.0, 1000.0], [3.0, 4.0, 1000.0])
-> ~1.601, ~2.135
forceVec([-3.0, -4.0, 1000.0], [3.0, 4.0, 1000.0])
-> ~0.40, ~0.53
(or ~0.80, ~1.067
due to numerical issues)forceVec([-3.0, -4.0, 1000.0], [-6.0, -8.0, 1000.0])
-> ~ -1.601, ~ -2.135
(or ~0.32, ~0.42
due to numerical issues)