Skip to content
Open
Changes from all commits
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
8 changes: 3 additions & 5 deletions opendis/RangeCoordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ class GPS:

wgs84 = WGS84()

_IDENTITY_3X3 = identity(3)

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 +518,16 @@ def rotate_3x3(self, theta, normal_vec):
the rotation.
"""

n_v_t = normal_vec.transpose()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

n_v_t appears to be unused, makes sense to remove it. Good find.


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