G.1.10 Orthogonal_Mathematic_Vector Procedure

The main documentation of the Orthogonal_Mathematic_Vector Procedure contains additional explanation of this code listing.

  function Orthogonal_Mathematic_Vector (MV1, MV2) result(Orthogonal)
    ! Use association information.

    use Caesar_Numbers_Module, only: zero

    ! Input variables.

    ! Mathematic Vectors to be dotted.
    type(Mathematic_Vector_type), intent(in) :: MV1, MV2 
    ! Output variable.
    type(logical) :: Orthogonal         ! Result of dot product.
    ! Verify requirements.
    VERIFY(Valid_State(MV1),5)          ! MV1 is valid.
    VERIFY(Valid_State(MV2),5)          ! MV2 is valid.

    ! Calculate whether the two vectors are orthogonal.
    Orthogonal = Dot_Product(MV1%Values, MV2%Values) .eq. zero
    ! Verify guarantees -- none.

  end function Orthogonal_Mathematic_Vector

Michael L. Hall