//functions for making openbabel easier to work with, adding functionality that isn't in the api(also adding functionality that is in the regular api, but isn't in the C# api), and functions that make debugging less of a pain //this is in a partial class for now, but it would be pretty useful as a library #region functions for converting double arrays to their openbabel counterparts and vice versa public static double[] obvec2dubs(OBVector3 a) { //turns a horrible obvector into a very nice double array double[] b = { a.GetX(), a.GetY(), a.GetZ() }; return(b); }
public static double atomdist(OBAtom a0, OBAtom a1) { OBVector3 disp = OBVector3.Sub(a0.GetVector(), a1.GetVector()); double x = disp.GetX(); double y = disp.GetY(); double z = disp.GetZ(); double dist = Math.Sqrt(x * x + y * y + z * z); return(dist); }