Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(vector) | :: | vec | ||||
real(kind=r64) | :: | roundto |
SUBROUTINE VecRound(vec,roundto)
! PURPOSE OF THIS SUBROUTINE:
! This subroutine rounds the input vector to a specified "rounding" value.
! REFERENCE:
! Graphic Gems.
IMPLICIT NONE
! SUBROUTINE ARGUMENT DEFINITIONS:
type (vector) vec
real(r64) :: roundto
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
! na
vec%x=ANINT(vec%x*roundto,r64)/roundto
vec%y=ANINT(vec%y*roundto,r64)/roundto
vec%z=ANINT(vec%z*roundto,r64)/roundto
return
END SUBROUTINE VecRound