code: public Pair<Atom> getAxisEnds(Atom[] atoms) {
  		// Project each Atom onto the rotation axis to determine limits
  		double min, max;
  		min = max = Calc.scalarProduct(rotationAxis,atoms[0]);
  		for(int i=1;i<atoms.length;i++) {
  			double prod = Calc.scalarProduct(rotationAxis,atoms[i]);
  			if(prod<min) min = prod;
  			if(prod>max) max = prod;
  		}
  		double uLen = Calc.scalarProduct(rotationAxis,rotationAxis);// Should be 1, but double check
  		min/=uLen;
  		max/=uLen;
  
  		// Project the origin onto the axis. If the axis is undefined, use the center of mass
  		Atom axialPt;
  		if(rotationPos == null) {
  			Atom center = Calc.centerOfMass(atoms);
  
  			// Project center onto the axis
  			Atom centerOnAxis = Calc.scale(rotationAxis, Calc.scalarProduct(center, rotationAxis));
  
  			// Remainder is projection of origin onto axis
  			axialPt = Calc.subtract(center, centerOnAxis);
  
  		} else {
  			axialPt = rotationPos;
  		}
  
  		// Find end points of the rotation axis to display
  		Atom axisMin = (Atom) axialPt.clone();
  		Calc.scaleAdd(min, rotationAxis, axisMin);
  		Atom axisMax = (Atom) axialPt.clone();
  		Calc.scaleAdd(max, rotationAxis, axisMax);
  
  		return new Pair<>(axisMin, axisMax);
  	}
docs: Find a segment of the axis that covers the specified set of atoms.
  <p>
  Projects the input atoms onto the rotation axis and returns the bounding
  points.
  <p>
  In the case of a pure translational axis, the axis location is undefined
  so the center of mass will be used instead.
  @param atoms
  @return two points defining the axis segment