An effective algorithm for buffering a polyline to create a polygon?
I need to write some code that will buffer a line to create a polygon as shown below.

http://www.sli.unimelb.edu.au/gisweb/BuffersModule/Buff_line.htm

From following the steps outlined, I can create polygon shapes around simple lines that do not cross themselves or have too tight curves, but as the lines I'm trying to buffer are squiggly swhirly hurricane tracks, it's really not good enough. 

I know there's a function in SQL Server 2008 that can do this, but I'm afraid that's currently a no go.

Can anyone point me in the direction of a more complete algorithm I can follow, or any background info that could help me figure this out?
An effective algorithm for buffering a polyline to create a polygon?
===

I need to write some code that will buffer a line to create a polygon as shown below.

http://www.sli.unimelb.edu.au/gisweb/BuffersModule/Buff_line.htm

From following the steps outlined, I can create polygon shapes around simple lines that do not cross themselves or have too tight curves, but as the lines I'm trying to buffer are squiggly swhirly hurricane tracks, it's really not good enough. 

I know there's a function in SQL Server 2008 that can do this, but I'm afraid that's currently a no go.

Can anyone point me in the direction of a more complete algorithm I can follow, or any background info that could help me figure this out?