|
1 | 1 | .. _tutorials/vincenty: |
2 | 2 |
|
3 | | -Vincenty Formula |
4 | | -================ |
| 3 | +Connecting Two Points |
| 4 | +===================== |
| 5 | + |
| 6 | +GeodePy has the ability to calculate the relationship between two points in two different ways, either on a flat plane or curved plane. |
| 7 | + |
| 8 | +Flat plane |
| 9 | +---------- |
| 10 | + |
| 11 | +To calculate the distance and bearing between two points the following command can be used. |
| 12 | + |
| 13 | +.. code:: python |
| 14 | +
|
| 15 | + import geodepy.survey |
| 16 | + import geodepy.angles |
| 17 | +
|
| 18 | + connection = geodepy.survey.joins(696053.337, 6086610.13, 696770.781, 6086089.772) |
| 19 | + bearing = connection[1] |
| 20 | + bearing = geodepy.angles.dec2dms(bearing) |
| 21 | +
|
| 22 | + print(f"The connection is: {connection[0]:.4f} @ {bearing}") |
| 23 | +
|
| 24 | + >>The connection is: 886.2834 @ 125 57 11.37834570 |
| 25 | +
|
| 26 | +Here the first number is distance while the second is the bearing. It might look clearer when converting the bearng to DMS |
| 27 | + |
| 28 | +You can also determine the coordinate of a second point given first coordinate and a bearing and distance. |
| 29 | + |
| 30 | +.. code:: python |
| 31 | +
|
| 32 | + coord = geodepy.survey.radiations(696053.337, 6086610.13, bearing.dec(), 886.2834) |
| 33 | + print(f"The point 2 coord is: {coord[0]:.3f} {coord[1]:.3f}") |
| 34 | +
|
| 35 | + >>The point 2 coord is: 696770.781 6086089.772 |
| 36 | +
|
| 37 | +As can be seen this value matches the coordinate of the second point entered in the joins function. |
| 38 | + |
| 39 | +Curved Plane |
| 40 | +------------ |
| 41 | + |
| 42 | +To calculate the joins between two points on a curved plan vincenty's formula can be used. In this example we will |
| 43 | +use the utm vincenty functions but tihs same process can be undertaken using the normal formulas and lat and longs. |
| 44 | + |
| 45 | +.. code:: python |
| 46 | +
|
| 47 | + import geodepy.geodesy |
| 48 | + import geodepy.angles |
| 49 | +
|
| 50 | + connection2 = geodepy.geodesy.vincinv_utm(55, 696053.337, 6086610.13, 55, 696770.781, 6086089.772) |
| 51 | + bearing2 = connection2[1] |
| 52 | + bearing2 = geodepy.angles.dec2dms(bearing2) |
| 53 | +
|
| 54 | + print(f"The connection is: {connection2[0]:.4f} @ {bearing2}") |
| 55 | +
|
| 56 | + >>The connection is: 886.2839 @ 125 57 11.1186109 |
| 57 | +
|
| 58 | +As seen here the connection is slightly different between the flat and curved plane. |
| 59 | + |
| 60 | +The coordinate of a second point can also be calculated. |
| 61 | + |
| 62 | +.. code:: python |
| 63 | +
|
| 64 | + coord2 = geodepy.geodesy.vincdir_utm(55, 696053.337, 6086610.13, bearing2.dec(), 886.2839) |
| 65 | + print(f"The point 2 coord is: {coord2[1]:.3f} {coord2[2]:.3f}") |
| 66 | +
|
| 67 | + >>The point 2 coord is: 696770.781 6086089.772 |
| 68 | +
|
| 69 | +Again it can be seen that this coordinate matches what was entered earlier. |
0 commit comments