Rotating images
By default sphMapping
only maps the xy-plane. To change the mapping you have two options, Project along axis and Define Euler Angle.
Project along axis
If you only want to change the axis along which you want to project the data you can use the wrapper function project_along_axis
.
SPHtoGrid.project_along_axis
— Functionproject_along_axis!(x::Array{<:Real}, projection_axis::Integer=3)
Projects and array of 3D along one of the principle axes. projection_axis ∈ {1, 2, 3} => x, y, z axis.
If you for example want to project along the x-axes, so in the yz-plane use
axis = 1
pos_new = (pos_old, axis)
Define Euler Angle
If projection along one of the principle axis is too crude for you, you can define individual angles α, β and γ corresponding to rotations around the x, y, and z-axis respectively and use the function rotate_3D
. This function uses Rotations.jl.
SPHtoGrid.rotate_3D
— Functionrotate_3D(x::Array{<:Real}, alpha::Real, beta::Real, gamma::Real)
Rotates and array of 3D positions around the euler angles α, β and γ corresponding to rotations around the x, y, and z-axis respectively. α, β and γ need to be given in degrees.
These angles have to be given in degrees. So to rotate a 3D quantity 45 degrees around the x-axis you can use:
pos_new = rotate_3D(pos_old, 45.0, 0.0, 0.0)