magnitude Function

public pure elemental function magnitude(this)

Returns the magnitude of a vec3

Type Bound

vector

Arguments

Type IntentOptional Attributes Name
class(vector), intent(in) :: this

Return Value type(vector)


Source Code

        type(vector) pure elemental function magnitude(this)
            !! Returns the magnitude of a vec3

            class(vector), intent(in) :: this

            real(kind=wp) :: tmp

            tmp = this%length()
            magnitude = this / tmp

        end function magnitude