vec_dot_vec Function

private pure elemental function vec_dot_vec(a, b) result(dot)

dot product between two vec4s

Type Bound

vec4

Arguments

Type IntentOptional Attributes Name
class(vec4), intent(in) :: a

Input vec4

type(vec4), intent(in) :: b

vec4 to dot with

Return Value real(kind=wp)


Source Code

        pure elemental function vec_dot_vec(a, b) result (dot)
            !! dot product between two vec4s
            !> Input vec4
            class(vec4), intent(IN) :: a
            !> vec4 to dot with
            type(vec4),  intent(IN) :: b

            real(kind=wp) :: dot

            dot = (a%x * b%x) + (a%y * b%y) + (a%z * b%z) + (a%p * b%p)

        end function vec_dot_vec