Convert machine coordinate uvw
to beam coordinate xyz
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=Float64), | intent(in), | dimension(3) | :: | uvw | ||
real(kind=Float64), | intent(out), | dimension(3) | :: | xyz |
subroutine uvw_to_xyz(uvw,xyz)
!+ Convert machine coordinate `uvw` to beam coordinate `xyz`
real(Float64), dimension(3), intent(in) :: uvw
real(Float64), dimension(3), intent(out) :: xyz
real(Float64), dimension(3) :: origin, uvw_p
real(Float64), dimension(3,3) :: basis
origin = beam_grid%origin
basis = beam_grid%inv_basis
uvw_p = uvw - origin
xyz = matmul(basis,uvw_p)
end subroutine uvw_to_xyz