-
-
Notifications
You must be signed in to change notification settings - Fork 227
Expand file tree
/
Copy pathmatrix_lib.py
More file actions
30 lines (21 loc) · 634 Bytes
/
matrix_lib.py
File metadata and controls
30 lines (21 loc) · 634 Bytes
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
29
30
"""
matrix_lib.py
Author: Shisato Yano
"""
import numpy as np
from math import sin, cos
def hom_mat_33(x, y, yaw):
"""
Homogeneous transformation matrix 3x3
x: x direction translation[m]
y: y direction translation[m]
yaw: yaw direction rotation[rad]
"""
cos_yaw, sin_yaw = cos(yaw), sin(yaw)
return np.array([[cos_yaw, -sin_yaw, x],
[sin_yaw, cos_yaw, y],
[0.0, 0.0, 1.0]])
def rot_mat_22(yaw):
cos_yaw, sin_yaw = cos(yaw), sin(yaw)
return np.array([[cos_yaw, -sin_yaw],
[sin_yaw, cos_yaw]])