Euler Spiral - Code For Producing An Euler Spiral

Code For Producing An Euler Spiral

The following Sage code produces the second graph above. The first four lines express the Euler spiral component. Fresnel functions could not be found. Instead, the integrals of two expanded Taylor series are adopted. The remaining code expresses respectively the tangent and the circle, including the computation for the center coordinates.

var('L') p = integral(taylor(cos(L^2), L, 0, 12), L) q = integral(taylor(sin(L^2), L, 0, 12), L) r1 = parametric_plot(, (L, 0, 1), color = 'red') r2 = line(, rgbcolor = 'blue') x1 = p.subs(L = 1) y1 = q.subs(L = 1) R = 0.5 x2 = x1 - R*sin(1.0) y2 = y1 + R*cos(1.0) r3 = circle((x2, y2), R, rgbcolor = 'green') show(r1 + r2 + r3, aspect_ratio = 1, axes=false)

The following is Mathematica code for the Euler spiral component (it works directly in wolframalpha.com):

ParametricPlot[ {FresnelC] t]/Sqrt], FresnelS] t]/Sqrt]}, {t, -10, 10}]

Read more about this topic:  Euler Spiral

Famous quotes containing the words code, producing and/or spiral:

    ...I had grown up in a world that was dominated by immature age. Not by vigorous immaturity, but by immaturity that was old and tired and prudent, that loved ritual and rubric, and was utterly wanting in curiosity about the new and the strange. Its era has passed away, and the world it made has crumbled around us. Its finest creation, a code of manners, has been ridiculed and discarded.
    Ellen Glasgow (1873–1945)

    Sir, I do not call a gamester a dishonest man; but I call him an unsocial man, an unprofitable man. Gaming is a mode of transferring property without producing any intermediate good.
    Samuel Johnson (1709–1784)

    Year after year beheld the silent toil
    That spread his lustrous coil;
    Still as the spiral grew,
    He left the past year’s dwelling for the new,
    Stole with soft step its shining archway through,
    Built up its idle door,
    Stretched in his last-found home, and knew the old no more.
    Oliver Wendell Holmes, Sr. (1809–1894)