How can I get a closely approximation of the golden spiral?

The two objects are the same and the golden spiral. I think it is more a mathematical question than an asymptote one. It is a variable problem and the way (in direction to the center or not) to describe the spiral.

To compare it is better to have the same scaling, so avoid pic.fit. Then you have to do some computations.

In the first case (up to the translation and a rotation), the equation is in polar coordinates phi=-pi t/2 r=m^t. If u=-pi/2 t we have in the variable u, the polar coordinates phi=u, r=m^(-2 u /pi). It follows that in u, r=exp(-u *2log(m)/pi) and -2log(m)/pi=tan(17.03239). Up to a scaling, a rotation and the choice of the interval both examples are the same : golden spiral. You can observe on the following example

import graph;
size(400);
pair A=(0,0),C=(1,1),M=(A+(C.x,A.y))/2;
real tmax=degrees(C-M)-degrees((C.x,A.y)-M);
pair K=rotate(-tmax,M)*C;

pair Inter=intersectionpoint((A.x,C.y)--(K.x,A.y),(K.x,C.y)--(C.x,A.y));
real m=1/(1+abs((K.x,C.y)-C));
// write(m); // 0.618033988749895

int N=100;
pair Z[];
for (int i=0; i<=N;++i)
{
 real t= i/10;
  Z.push(rotate(-t*90,Inter)*(Inter+m^t*(A-Inter)));
}
draw(shift(A-Inter)*(operator .. (... Z)),red);
pair A=(0,0),C=(1,1),M=(A+(C.x,A.y))/2;
real tmax=degrees(C-M)-degrees((C.x,A.y)-M);
pair K=rotate(-tmax,M)*C;
real a=abs(Inter), k=Tan(17.03239);
k=log(1+m)/(pi/2);
real f(real t) {return a*exp(k*(t-pi-angle(Inter)));}
path g=polargraph(f,-6pi+angle(Inter),angle(Inter)+pi,500,operator ..);
draw(rotate(0)*g,lightblue+white);

shipout(bbox(2mm,invisible));

and the picture

enter image description here

An interesting picture should be the approximation by quarter circles, Fibonacci sequences.

Tags:

Asymptote