unitvector Function

public pure function unitvector(v) result(r)

If the argument has a finite norm, then it will be rescaled to a unit vector. If that norm is zero, then a zero vector is returned instead.

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(3):: v

Vector

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

Unit vector


Contents

None