Giter Site home page Giter Site logo

range issue of dihedral_angle() about easyeda HOT 1 OPEN

kangmg avatar kangmg commented on August 26, 2024
range issue of dihedral_angle()

from easyeda.

Comments (1)

kangmg avatar kangmg commented on August 26, 2024

아래 함수로 대체하면 문제없이 작동하지만 조금 더 확인 필요

def dihedral_angle(atom1, atom2, atom3, atom4):
    
    b2 = np.array(atom3) - np.array(atom2)
    b1 = np.array(atom2) - np.array(atom1)
    b3 = np.array(atom4) - np.array(atom3)

    v1 = np.cross(b1, b2)
    v2 = np.cross(b2, b3)

    angle = np.arccos(np.dot(v1, v2) / (np.linalg.norm(v1) * np.linalg.norm(v2)))
    angle_degrees = np.degrees(angle)

    if np.dot(np.cross(v1, v2), b2) < 0:
        angle_degrees = 360 - angle_degrees

    return angle_degrees

from easyeda.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.