I'm looking for a function that will return a tangent (and normal) for a LINESTRING in PostGIS. I think this is the 3rd time I've come across the need for this function and everytime, I end porting whatever I'm working on to c#/ArcObjects in order to use the [QueryTangent](http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//002m00000117000000)/[QueryNormal](http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#/QueryNormal_Method/002m00000114000000/) method rather than make the effort to research a PostGIS option.

Is there an existing functions in PostGIS (I'm not tied to a specific version)?

And if it doesn't exist, has anyone already written it and wouldn't mind posting it as an answer?