mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/SPATZ.git
synced 2025-06-10 01:55:59 +00:00
Added cosine matrices to astos directory
This commit is contained in:
parent
478fcf0a5b
commit
6555009a94
36
spatz/simulations/astos/transforms.py
Normal file
36
spatz/simulations/astos/transforms.py
Normal file
@ -0,0 +1,36 @@
|
||||
import math
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
||||
DEG_TO_RADS = math.pi / 180
|
||||
|
||||
|
||||
def T1(angle, degrees=False):
|
||||
angle = angle * DEG_TO_RADS if degrees else angle
|
||||
|
||||
return np.array([
|
||||
[1, 0, 0],
|
||||
[0, math.cos(angle), math.sin(angle)],
|
||||
[0, -math.sin(angle), math.cos(angle)],
|
||||
])
|
||||
|
||||
|
||||
def T2(angle, degrees=False):
|
||||
angle = angle * DEG_TO_RADS if degrees else angle
|
||||
|
||||
return np.array([
|
||||
[math.cos(angle), 0, -math.sin(angle)],
|
||||
[0, 1, 0],
|
||||
[math.sin(angle), 0, math.cos(angle)]
|
||||
])
|
||||
|
||||
|
||||
def T3(angle, degrees=False):
|
||||
angle = angle * DEG_TO_RADS if degrees else angle
|
||||
|
||||
return np.array([
|
||||
[math.cos(angle), math.sin(angle), 0],
|
||||
[-math.sin(angle), math.cos(angle), 0],
|
||||
[0, 0, 1]
|
||||
])
|
Loading…
x
Reference in New Issue
Block a user