public static Atom vectorProduct(Atom a, Atom b) { Atom c = new Atom(); c.setX(a.getY() * b.getZ() - a.getZ() * b.getY()); c.setY(a.getZ() * b.getX() - a.getX() * b.getZ()); c.setZ(a.getX() * b.getY() - a.getY() * b.getX()); return(c); }
public static double angle(Atom a, Atom b) { Vector3D va = new Vector3D(a.getX(), a.getY(), a.getZ()); Vector3D vb = new Vector3D(b.getX(), b.getY(), b.getZ()); return Vector3D.AngleBetween(va, vb); }
public static double angle(Atom a, Atom b) { Vector3D va = new Vector3D(a.getX(), a.getY(), a.getZ()); Vector3D vb = new Vector3D(b.getX(), b.getY(), b.getZ()); return(Vector3D.AngleBetween(va, vb)); }
public static double getDistanceFast(Atom a, Atom b) { double x = a.getX() - b.getX(); double y = a.getY() - b.getY(); double z = a.getZ() - b.getZ(); return x * x + y * y + z * z; }
public static double getDistanceFast(Atom a, Atom b) { double x = a.getX() - b.getX(); double y = a.getY() - b.getY(); double z = a.getZ() - b.getZ(); return(x * x + y * y + z * z); }
public static Atom add(Atom a, Atom b) { Atom c = new Atom(); c.setX(a.getX() + b.getX()); c.setY(a.getY() + b.getY()); c.setZ(a.getZ() + b.getZ()); return c; }
public static double getDistance(Atom a, Atom b) { double x = a.getX() - b.getX(); double y = a.getY() - b.getY(); double z = a.getZ() - b.getZ(); double s = x * x + y * y + z * z; return Math.Sqrt(s); }
public static Atom subtract(Atom a, Atom b) { Atom c = new Atom(); c.setX(a.getX() - b.getX()); c.setY(a.getY() - b.getY()); c.setZ(a.getZ() - b.getZ()); return(c); }
public static Atom add(Atom a, Atom b) { Atom c = new Atom(); c.setX(a.getX() + b.getX()); c.setY(a.getY() + b.getY()); c.setZ(a.getZ() + b.getZ()); return(c); }
public static double getDistance(Atom a, Atom b) { double x = a.getX() - b.getX(); double y = a.getY() - b.getY(); double z = a.getZ() - b.getZ(); double s = x * x + y * y + z * z; return(Math.Sqrt(s)); }
public static Atom unitVector(Atom a) { double amnt = amount(a); double[] coords = new double[3]; coords[0] = a.getX() / amnt; coords[1] = a.getY() / amnt; coords[2] = a.getZ() / amnt; a.setCoords(coords); return(a); }
public static Atom vectorProduct(Atom a, Atom b) { Atom c = new Atom(); c.setX(a.getY() * b.getZ() - a.getZ() * b.getY()); c.setY(a.getZ() * b.getX() - a.getX() * b.getZ()); c.setZ(a.getX() * b.getY() - a.getY() * b.getX()); return c; }
public static Atom unitVector(Atom a) { double amnt = amount(a); double[] coords = new double[3]; coords[0] = a.getX() / amnt; coords[1] = a.getY() / amnt; coords[2] = a.getZ() / amnt; a.setCoords(coords); return a; }
public static Atom subtract(Atom a, Atom b) { Atom c = new Atom(); c.setX(a.getX() - b.getX()); c.setY(a.getY() - b.getY()); c.setZ(a.getZ() - b.getZ()); return c; }
public static double scalarProduct(Atom a, Atom b) { return a.getX() * b.getX() + a.getY() * b.getY() + a.getZ() * b.getZ(); }
public static double scalarProduct(Atom a, Atom b) { return(a.getX() * b.getX() + a.getY() * b.getY() + a.getZ() * b.getZ()); }