adobe illustrator art brush, how does it work? I want to find out how the art brush in adobe illustrator works.  

It looks like it's taking some vector art and applying it to a smooth line. 



How can I go about implementing this?
These rely on a transformation from global coordinates to path local coordinates, where the local axes are along and out (or more often u and v). In essence this all works on a principle similar to how offset works.



Image 1: Depiction of local axes.

Now the first one ($A$) is a sweep of an oval. Which is technically the most challenging of the four. In essence You offset edges directionally and cap them with a fixed directional oval. Although this has all kinds of interesting edge cases. A lot of mathematical lore is known about sweeping shapes as this is somewhat hard to do in 3D and doing so with an arbitrary shape is useful for the cad crowd. At it simplest its just sampling many times, which allows for change in shape along line, but quite sophisticated approaches are available.



Image 2: Oval sweep.

The second is simply (bombing) a shape in random places in the new coordinate system. Mathematically this is pretty simple. Generate a number in along direction then find that point. Then generate a second number and multiply that by the normal direction vector of your path then add this to the point.

The third and fourth just do this for a lot of points read in form a Cartesian template object. Again you should familiarize yourself with how offset and graduated offset is done. You can find a lot of references but one of my favorite online resource for Béziers is in the Pomax Bézier primer. Its just lot of small offset lines to transform from.