One must use the functions in the Spatial module to compute the distance, angle, dihedral, etc. Even though it provides a generic API accepting several argument combinations, it may hurt discoverability (functionality is spread across multiple modules) and so it may be more convenient to have them as methods on Vec3, e.g.,
Chem::Spatial.distance v1, v2
Chem::Spatial.angle v1, v2
# vs
v1.distance_to(v2)
v1.angle_to(v2)
However, function overloads that require more than 2 arguments may prove difficult to translate:
Chem::Spatial.dihedral v1, v2, v3, v4
# vs
v1.dihedral v2, v3, v4 # or some alternative
One must use the functions in the
Spatial
module to compute the distance, angle, dihedral, etc. Even though it provides a generic API accepting several argument combinations, it may hurt discoverability (functionality is spread across multiple modules) and so it may be more convenient to have them as methods onVec3
, e.g.,However, function overloads that require more than 2 arguments may prove difficult to translate: