Skip to content

possible code errors #40

@qkligit

Description

@qkligit

Hi,

In file internalcoordinates.cpp, It seems that the 2nd function should be multiplied by DegreesToRadians rather than RadiansToDegress. Also, the bond length r should not be multiplied by RadiansToDegrees, the same is true for ::coordinatesRidians().

// --- Coordinates --------------------------------------------------------- //
/// Sets the distance, angle, and torsion at \p row to \p r,
/// \p theta and \p phi respectively. The angles are in degrees.
void InternalCoordinates::setCoordinates(size_t row, Real r, Real theta, Real phi)
{
assert(row < d->size);

 d->coordinates[row * 3 + 0] = r;
 d->coordinates[row * 3 + 1] = theta;
 d->coordinates[row * 3 + 2] = phi;

}

/// Sets the distance, angle, and torsion at \p row to \p r,
/// \p theta and \p phi respectively. The angles are in radians.
void InternalCoordinates::setCoordinatesRadians(size_t row, Real r, Real theta, Real phi)
{
assert(row < d->size);

 d->coordinates[row * 3 + 0] = r * chemkit::constants::RadiansToDegrees;
 d->coordinates[row * 3 + 1] = theta * chemkit::constants::RadiansToDegrees;
 d->coordinates[row * 3 + 2] = phi * chemkit::constants::RadiansToDegrees;

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions