I'm coding renderer for road network, which based on the RoadXML format.
Road curves from this format has four types:
- segment,
- circle arc,
- poly line,
- clotho arc.
And I have problem with the last one.
Clothoid is the same with Euler spiral and Cornu spiral. In the RoadXML clotho arc is given by three parameters:
- start curvature,
- end curvature,
- length.
For arc triangulation I need a function like foo(t), which returns (x, y) coords for t = 0..length. I created similar methods for circle arc without problems, but I can't do it for clotho arc.
Part of the problem is that I not totally understand how to apply start and end curvature parameters in standard clothoid formulas.
For example, sample RoadXML road. RoadXML sample http://img560.imageshack.us/img560/8172/bigroandabout.png
This is clotho curve item in the red ellipse. It's parameters:
- start curvature = 0,
- end curvature = -0.0165407,
- length = 45.185.
I don't know how to implement these parameters, because clothoid curvature from 0 to -0.0165 is very straight.
I will happy, if you give me a code of this function (in C++, C#, Java, Python or pseudocode) or just a formula, which I can code.
Here is my equations:
x(t) ≈ t,
y(t) ≈ (t^3) / 6,
where length = t = s = curvature.
x(-0.0165) = -0.0165,
y(-0.0165) = -7.48688E-07.
Clotho length = 0.0165,
Source length = 45.185.
Scaled coords:
x'(l) = x / clotho_length * source_length = 45.185,
y'(l) = y / clotho_length * source_length = 5.58149E-07 ≈ 0.
x'(0) = 0,
y'(0) = 0.
Thus I get (0, 0)...(45, 0) points, which is very straight.
Where is my mistake? What am I doing wrong?