Created
February 11, 2017 23:25
-
-
Save TimSC/faf3e3e361a939dcd9cf1b59e7bd851b to your computer and use it in GitHub Desktop.
Solve position of mary rose site
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| if __name__=="__main__": | |
| X = np.ones((4, 4)) | |
| X[:, :2] = [[663, 706], [1303, 74], [2491, 1302], [2935, 747]] | |
| X[:, 2] = X[:, 0] * X[:, 1] | |
| lats = 50.777453115, 50.7856611742, 50.7704862, 50.778133 | |
| coeffLats = np.linalg.lstsq(X, lats)[0] | |
| x = [2209, 1851, 2209*1851, 1] | |
| lons = -1.1347460669, -1.1222460927, -1.098963, -1.0890155 | |
| coeffLons = np.linalg.lstsq(X, lons)[0] | |
| print sum(coeffLats * x), sum(coeffLons * x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment