Function that calculates and returns the cross product . These vectors are in Cartesian coordinates.
Notice that all the variables in this subroutine have been normalized using the characteristic scales in korc_units.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=rp), | intent(in), | DIMENSION(3) | :: | a | Vector . |
|
real(kind=rp), | intent(in), | DIMENSION(3) | :: | b | Vector . |
Value of
pure function cross(a,b)
!! @note Function that calculates and returns the cross product
!! \(\mathbf{a}\times \mathbf{b}\). These vectors are in Cartesian
!! coordinates. @endnote
!! @note Notice that all the variables in this subroutine have been
!! normalized using the characteristic scales in [[korc_units]]. @endnote
REAL(rp), DIMENSION(3), INTENT(IN) :: a
!! Vector \(\mathbf{a}\).
REAL(rp), DIMENSION(3), INTENT(IN) :: b
!! Vector \(\mathbf{b}\).
REAL(rp), DIMENSION(3) :: cross
!!Value of \(\mathbf{a}\times \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