cross Function

private pure function cross(a, b)

Arguments

Type IntentOptional AttributesName
real(kind=rp), intent(in), DIMENSION(3):: a

Vector .

real(kind=rp), intent(in), DIMENSION(3):: b

Vector .

Return Value real(kind=rp), DIMENSION(3)

Cross product


Called by

proc~~cross~2~~CalledByGraph proc~cross~2 cross proc~unitvectors unitVectors proc~unitvectors->proc~cross~2 proc~gyro_distribution gyro_distribution proc~gyro_distribution->proc~unitvectors

Contents

Source Code


Source Code

  pure function cross(a,b)
    !! @note Function that calculates the cross product of the two
    !! vectors \(\mathbf{a}\) and \(\mathbf{b}\). @endnote
    REAL(rp), DIMENSION(3)             :: cross
    !! Cross product \(\mathbf{a}\times \mathbf{b}\)
    REAL(rp), DIMENSION(3), INTENT(IN) :: a
    !!  Vector \(\mathbf{a}\).
    REAL(rp), DIMENSION(3), INTENT(IN) :: b
    !!  Vector \(\mathbf{b}\).

    cross(1) = a(2)*b(3) - a(3)*b(2)
    cross(2) = a(3)*b(1) - a(1)*b(3)
    cross(3) = a(1)*b(2) - a(2)*b(1)
  end function cross