-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
executable file
·28 lines (22 loc) · 917 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#! /usr/bin/env python
from coordinates import CartesianPoint, CartesianVector, ECEF, GeodeticPoint, \
HorizontalVector, LtpFrame, SphericalPoint, \
_units as units
if __name__ == '__main__':
geodetic = GeodeticPoint(45, 3, units=units.deg)
frame = LtpFrame(geodetic, orientation='ENU', magnetic=False)
cartesian = CartesianPoint.new(geodetic, frame)
spherical = SphericalPoint.new(cartesian, frame=ECEF)
vz = CartesianVector((0, 0, 1), units=units.m, frame=frame)
horizontal = HorizontalVector.new(vz)
print(geodetic)
print(cartesian)
print(spherical)
print(vz)
print(horizontal)
geodetic = GeodeticPoint.new(cartesian)
print(geodetic)
cartesian = CartesianPoint(((1, 2, 3), (4, 5, 6)), units=units.m)
cartesian.x = 5 * units.m
print(cartesian)
print(type(cartesian.xyz.magnitude))