def x_axis_transform(compound, new_origin=None,
                     point_on_x_axis=None,
                     point_on_xy_plane=None):
    """Move a compound such that the x-axis lies on specified points.

    Parameters
    ----------
    compound : mb.Compound
        The compound to move.
    new_origin : mb.Compound or list-like of size 3, optional, default=[0.0, 0.0, 0.0]
        Where to place the new origin of the coordinate system.
    point_on_x_axis : mb.Compound or list-like of size 3, optional, default=[1.0, 0.0, 0.0]
        A point on the new x-axis.
    point_on_xy_plane : mb.Compound, or list-like of size 3, optional, default=[1.0, 0.0, 0.0]
        A point on the new xy-plane.

    """
    import mbuild as mb

    if new_origin is None:
        new_origin = np.array([0, 0, 0])
    elif isinstance(new_origin, mb.Compound):
        new_origin = new_origin.pos
    elif isinstance(new_origin, (tuple, list,np.ndarray)):
        new_origin = np.asarray(new_origin)
    else:
        raise TypeError('x_axis_transform, y_axis_transform, and z_axis_transform only accept'
                        ' mb.Compounds, list-like of length 3 or None for the new_origin'
                        ' parameter. User passed type: {}.'.format(type(new_origin)))
    if point_on_x_axis is None:
        point_on_x_axis = np.array([1.0, 0.0, 0.0])
    elif isinstance(point_on_x_axis, mb.Compound):
        point_on_x_axis = point_on_x_axis.pos
    elif isinstance(point_on_x_axis, (list, tuple, np.ndarray)):
        point_on_x_axis = np.asarray(point_on_x_axis)
    else:
        raise TypeError('x_axis_transform, y_axis_transform, and z_axis_transform only accept'
                        ' mb.Compounds, list-like of size 3, or None for the point_on_x_axis'
                        ' parameter. User passed type: {}.'.format(type(point_on_x_axis)))    
    if point_on_xy_plane is None:
        point_on_xy_plane = np.array([1.0, 1.0, 0.0])
    elif isinstance(point_on_xy_plane, mb.Compound):
        point_on_xy_plane = point_on_xy_plane.pos
    elif isinstance(point_on_xy_plane, (list, tuple, np.ndarray)):
        point_on_xy_plane = np.asarray(point_on_xy_plane)
    else:
        raise TypeError('x_axis_transform, y_axis_transform, and z_axis_transform only accept'
                        ' mb.Compounds, list-like of size 3, or None for the point_on_xy_plane'
                        ' parameter. User passed type: {}.'.format(type(point_on_xy_plane)))

    atom_positions = compound.xyz_with_ports
    transform = AxisTransform(new_origin=new_origin,
                              point_on_x_axis=point_on_x_axis,
                              point_on_xy_plane=point_on_xy_plane)
    atom_positions = transform.apply_to(atom_positions)
    compound.xyz_with_ports = atom_positions
Move a compound such that the x-axis lies on specified points.

    Parameters
    ----------
    compound : mb.Compound
        The compound to move.
    new_origin : mb.Compound or list-like of size 3, optional, default=[0.0, 0.0, 0.0]
        Where to place the new origin of the coordinate system.
    point_on_x_axis : mb.Compound or list-like of size 3, optional, default=[1.0, 0.0, 0.0]
        A point on the new x-axis.
    point_on_xy_plane : mb.Compound, or list-like of size 3, optional, default=[1.0, 0.0, 0.0]
        A point on the new xy-plane.