Cornu spiral



----- Original Message ----- 
From: "Luigi Marino" <luigi_marino2 at alice.it>
To: "Edwin Woollett" <woollett at charter.net>
Sent: Sunday, December 07, 2008 1:10 AM
Subject: Cornu spiral


Mr. Edwin
It is possible draw the Cornu spiral
with Maxima by the equations integrals:
x(t)=int(cos(s^2*%pi/2),s,0,t)
y(t)=int(sin(s^2*%pi/2),s,0,t)   ?
I have try with integration by series.
Best wishes
luigi

PS  I have solved the problem for plotdf
after installed Maxima 5.16; before I have a
short version on Euler toolbox (by Grothmann).
====================
Hi Luigi,
The simplest approach so far is to use quad_qags
to evaluate the integrals required, make a list of
values, and use some sort of list plot.
I am using my qdraw package for plots,
available on my web page, and the
file fresnel.mac contains the definitions
of the simplest form of the Fresnel
integrals, which you can change to
Mathematica's def. if you want.
I am using qfft.mac simply to load
in my function short(..), which I
posted to the mailing list a few days ago.

(%i1) (display2d:false,fpprintprec:8)$
(%i2) load(fresnel)$
"fs(x)" = "fs(x)"

"fc(x)" = "fc(x)"

(%i3) fundef(fs);
(%o3) fs(x):=block([ttt],first(quad_qags(sin(ttt^2),ttt,0,x)))
(%i4) fundef(fc);
(%o4) fc(x):=block([ttt],first(quad_qags(cos(ttt^2),ttt,0,x)))
(%i5) map('fs,[0,1,2,3,4,5,6]);
(%o5) [0.0,0.310268,0.804776,0.773563,0.747134,0.527917,0.638459]
(%i6) map('fc,[0,1,2,3,4,5,6]);
(%o6) [0.0,0.904524,0.461461,0.702864,0.59446,0.611467,0.544204]
(%i7) tlist:makelist(j,j,0,500)/100.0$
(%i8) load(qfft);
 type qfft_syntax(); to see qfft,qift,dft,dift syntax
------------------------------------------

   type chop_syntax(); to see fchop and fchop1 use
(%o8) "c:/work3/qfft.mac"
(%i9) short(tlist)$
 there are  501  elements
  [ 0 , 0.01 <<, 497 elements,>> 4.99 , 5.0 ]
(%i10) fslist:map('fs,tlist)$
(%i11) short(fslist)$
 there are  501  elements
  [ 0.0 , 3.33333E-7 <<, 497 elements,>> 0.53 , 0.528 ]
(%i12) time(%o10);
(%o12) [1.34]
(%i13) tfslist:makelist([tlist[j],fslist[j]],j,1,501)$
(%i14) short(tfslist)$
 there are  501  elements
  [ [0,0.0] , [0.01,3.33333E-7] <<, 497 elements,>> [4.99,0.53] , 
[5.0,0.528] ]
(%i15) fclist:map('fc,tlist)$
(%i16) short(fclist)$
 there are  501  elements
  [ 0.0 , 0.01 <<, 497 elements,>> 0.602 , 0.611 ]
(%i17) time(%o15);
(%o17) [1.33]
(%i18) tfclist:makelist([tlist[j],fclist[j]],j,1,501)$
(%i19) short(tfclist)$
 there are  501  elements
  [ [0,0.0] , [0.01,0.01] <<, 497 elements,>> [4.99,0.602] , [5.0,0.611] ]
(%i20) (load(draw),load(qdraw))$
" qdraw(...), qdensity(...),
\
     general syntax: type qdraw()\$
\
     plotting data sets: type pts_syntax()\$ "

(%i21) qdraw(xr(-.5,6),yr(-.1,1), pts(tfclist,pt(0),pc(red),pj(2)),
                 pts(tfslist,pt(0),pc(blue),pj(2)) )$

this last shows S(x) and C(x) together as a function of x

Now make the list you need for the cornu spiral

x[j] = S(t[j]), and y[j] = C(t[j])
(%i22) cornulist:makelist([fslist[j],fclist[j]],j,1,501)$
(%i23) short(cornulist)$
 there are  501  elements
  [ [0.0,0.0] , [3.33333E-7,0.01] <<, 497 elements,>> [0.53,0.602] , 
[0.528,0.611] ]
(%i24) qdraw(xr(0,1),yr(0,1), pts(cornulist,pt(0),pc(red),pj(2)) )$
this last plot shows the cornu spiral for positive (x,y)

Ted Woollett
http://www.csulb.edu/~woollett/