Returns the magnitude of a vec3
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector), | intent(in) | :: | this |
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