ich haette gerne einen Hinweis um weiterzukommen.
Ein Matrix wird erstellt und manipuliert damit die Koordinaten rotiert werden um ein Achse, und dann im Polar-Modus PHI erhöht wird.
Siehe unten.
Erstes Problem: wie kommt man von einer Matrix0 auf X0 Y0 Z0 ? X0,Y0,Y0=Matrix0[?] wo
Code: Alles auswählen
Matrix0 = np.mgrid[ 0.01:1.1:5j, 0.01:1.1:5j, 0.01:1.1:5j]
Code: Alles auswählen
import numpy as np
from scipy.spatial.transform import Rotation as R
from astropy.coordinates import cartesian_to_spherical,spherical_to_cartesian
#X0, Y0, Z0 = np.mgrid[ 0.01:1.1:5j, 0.01:1.1:5j, 0.01:1.1:5j]
Matrix0 = np.mgrid[ 0.01:1.1:5j, 0.01:1.1:5j, 0.01:1.1:5j]
Matrix0.resize(5*5*5, 3)
r = R.from_rotvec(np.arccos((1/np.sqrt(3))) *np.array([1/np.sqrt(2), -1/np.sqrt(2), 0]))
Matrix = r.apply(Matrix0)
Matrix.resize(5,5,5,3)
X,Y,Z = Matrix # FIRST ISSUE IDENTIFIED THERE !!!!!!!!!!!!!!!!!!!!!!!!!!!!
R, Theta, Phi = cartesian_to_spherical(X,Y,Z)
Phi[:] += np.arccos(np.sqrt(2)/np.sqrt(3))
X,Y,Z = spherical_to_cartesian(R,Theta,Phi)