Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions opendis/RangeCoordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ class GPS:

wgs84 = WGS84()

_IDENTITY_3X3 = array([[1., 0., 0.],
[0., 1., 0.],
[0., 0., 1.]])
Comment thread
mcrrobinson marked this conversation as resolved.
Outdated

def ecef2lla(self, ecef, tolerance=1e-9):
"""Convert Earth-centered, Earth-fixed coordinates to lat, lon, alt.
Input: ecef - (x, y, z) in (m, m, m)
Expand Down Expand Up @@ -516,20 +520,16 @@ def rotate_3x3(self, theta, normal_vec):
the rotation.
"""

n_v_t = normal_vec.transpose()
Comment thread
leif81 marked this conversation as resolved.

n_x = array([[ 0 , -normal_vec[2], normal_vec[1] ],
[normal_vec[2] , 0 , -normal_vec[0]],
[-normal_vec[1], normal_vec[0] , 0 ]
]
)


I = identity(3)

nnt = normal_vec * self.transpose(normal_vec)

return (1 - cos(theta)) * nnt + cos(theta) * I + sin(theta) * n_x
return (1 - cos(theta)) * nnt + cos(theta) * self._IDENTITY_3X3 + sin(theta) * n_x


def transpose(self, arr):
Expand Down