cross_product Function

private pure function cross_product(x, y) result(z)

Returns the cross product of two vectors.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x(3)

Input vector

real(kind=wp), intent(in) :: y(3)

Input vector

Return Value real(kind=wp), (3)

Result


Called by

proc~~cross_product~~CalledByGraph proc~cross_product cross_product proc~marker_set_addcylinder marker_set%marker_set_AddCylinder proc~marker_set_addcylinder->proc~cross_product

Source Code

    pure function cross_product(x,y) result(z)
      !> Returns the cross product of two vectors.
      implicit none
      real(wp), intent(in) :: x(3)                                             !! Input vector
      real(wp), intent(in) :: y(3)                                             !! Input vector
      real(wp)             :: z(3)                                             !! Result

      z(1)=x(2)*y(3)-x(3)*y(2)
      z(2)=x(3)*y(1)-x(1)*y(3)
      z(3)=x(1)*y(2)-x(2)*y(1)

      return
    end function cross_product