code: public Point3d[] calculate3DCoordinatesSP2_2(Point3d aPoint, Point3d bPoint, Point3d cPoint, double length,
              double angle) {
          //logger.debug("3DCoordinatesSP_2");
          Vector3d ca = new Vector3d();
          Point3d newPoints[] = new Point3d[2];
          Vector3d ba = new Vector3d(bPoint);
          ba.sub(aPoint);
  
          if (cPoint != null) {
              ca.x = cPoint.x - aPoint.x;
              ca.y = cPoint.y - aPoint.y;
              ca.z = cPoint.z - aPoint.z;
          } else {
              ca.x = -1 * ba.x;
              ca.y = -1 * ba.y;
              ca.z = -1.5 * ba.z;
          }
  
          Vector3d crossProduct = new Vector3d();
          crossProduct.cross(ba, ca);
  
          Vector3d n1 = rotate(ba, crossProduct, 2 * angle);
          n1.normalize();
          n1.scale(length);
          newPoints[0] = new Point3d(aPoint);
          newPoints[0].add(n1);
  
          Vector3d n2 = rotate(n1, ba, Math.PI);
          n2.normalize();
          n2.scale(length);
          newPoints[1] = new Point3d(aPoint);
          newPoints[1].add(n2);
          n1 = null;
          n2 = null;
          ba = null;
          ca = null;
          return newPoints;
      }
docs: Calculate two new points in B-A system. It forms B-A(-X)(-X) system, where
  A is sp2
  
  @param  aPoint  central point A (Point3d)
  @param  bPoint  B (Point3d)
  @param  cPoint  C (Point3d)
  @param  length  bond length
  @param  angle   angle between B(C)-A-X
  @return         new Points (Point3d [])