Calculates velocity vector from pitch, gyroangle and fields
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=Float64), | intent(in) | :: | pitch | Pitch |
||
real(kind=Float64), | intent(in) | :: | gyroangle | Gyroangle [radians] |
||
type(LocalEMFields), | intent(in) | :: | fields | Electromagnetic fields |
||
real(kind=Float64), | intent(out), | dimension(3) | :: | vi_norm | Normalized velocity vector |
subroutine pitch_to_vec(pitch, gyroangle, fields, vi_norm)
!+ Calculates velocity vector from pitch, gyroangle and fields
real(Float64), intent(in) :: pitch
!+ Pitch
real(Float64), intent(in) :: gyroangle
!+ Gyroangle [radians]
type(LocalEMFields), intent(in) :: fields
!+ Electromagnetic fields
real(Float64), dimension(3), intent(out) :: vi_norm
!+ Normalized velocity vector
real(Float64) :: sinus
sinus = sqrt(max(1.d0-pitch**2,0.d0))
vi_norm = (sinus*cos(gyroangle)*fields%a_norm + &
pitch*fields%b_norm + &
sinus*sin(gyroangle)*fields%c_norm)
end subroutine pitch_to_vec