Closed gf712 closed 7 years ago
Hi Gil,
Thanks a lot for taking the time to do this! This is actually the first time anyone has made a pull request on one of my projects so I'm a little unsure of the process, but I appreciate the contribution.
I do need an angle_with
method, but currently I use my other library geometrica to handle geometry stuff (the rotate()
method of AtomicStructure is an example). However as I'm not likely to get around to that this release, this would be an excellent implementation for this and probably the next release.
I'm currently working in the 0.3 branch and when I'm finished that release (hopefully next week) I will try and merge your branch into that one (if you can merge pull requests into non-master branches - still new to me!).
Thanks again (and see you soon probably!), Sam
Hi, I saw that you needed to implement some code to calculate the angle between two bonds. I added the method
angle_with()
in theBond
class.angle_with
takes two parameters: anotherBond
object (bond_obj
) andin_degrees
, which expects a boolean and returns the angle of two bonds in degrees if set toTrue
.So for the angle between the OH bonds of water you would do the following:
I also created a private method in
Bond
to calculate the vector and a function to calculate the dot product.I hope this helps!