Skip to content

Commit

Permalink
Add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yiyeChen committed Jul 3, 2022
1 parent ba855cb commit f0b3065
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Lie/group/SE2/Homog.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,27 @@ def __init__(self, *args, **kwargs):
raise ValueError("Not a Homogenous matrix")

def getTranslation(self):
"""Get the translation vector
Returns:
trl (2, 1): The column translation vector
"""
return self.__M[0:2, 2][:,np.newaxis]

def getRotation(self):
"""Get the rotation matrix
Returns:
rot_mat (2, 2): The rotation vector
"""
return self.__M[0:2, 0:2]

def getAngle(self):
"""Get the rotation angle
Returns:
angle (float): The rotation angle
"""
return np.arctan2(self.__M[1,0], self.__M[0,0])

def inv(self):
Expand Down

0 comments on commit f0b3065

Please sign in to comment.