"""Python 3.14; root NumPy/Matplotlib dependencies. Writes one opaque PNG to cwd.""" import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np from math import pi,sqrt fig,axes=plt.subplots(2,3,figsize=(10.8,4.6),dpi=100,facecolor='white') angles=[pi/6,pi/3,pi/2,2*pi/3,5*pi/6,pi] labels=[r'$\theta=\pi/6$: saddle dominates',r'$\theta=\pi/3$: moving endpoint grows',r'$\theta=\pi/2$: half saddle, endpoint grows',r'$\theta=2\pi/3$: no saddle segment',r'$\theta=5\pi/6$: two endpoint terms',r'$\theta=\pi$: fixed endpoint dominates'] a=-1/sqrt(2) def arrow(ax,z,index=None,color='#185a9d'): index=len(z)//2 if index is None else index index=max(1,min(len(z)-2,index)) ax.annotate('',xy=(z[index+1].real,z[index+1].imag),xytext=(z[index-1].real,z[index-1].imag),arrowprops={'arrowstyle':'->','color':color,'lw':1.8,'mutation_scale':13}) for ax,theta,title in zip(axes.flat,angles,labels): b=np.exp(1j*theta) ax.axhline(0,color='.78',lw=.7);ax.axvline(0,color='.78',lw=.7) ax.plot([a,b.real],[0,b.imag],ls='--',color='.68',lw=1,label='Original segment') if abs(theta-pi/2)<1e-8: z=np.linspace(a,0,120).astype(complex);ax.plot(z.real,z.imag,color='#185a9d',lw=2);arrow(ax,z) z=1j*np.linspace(0,1,120);ax.plot(z.real,z.imag,color='#c4382f',lw=2);arrow(ax,z,color='#c4382f') elif abs(theta-pi)<1e-8: z=np.linspace(a,-1,100).astype(complex);ax.plot(z.real,z.imag,color='#c4382f',lw=2);arrow(ax,z,color='#c4382f') else: curve=np.sqrt(b*b+np.linspace(0,4,240,dtype=complex)) if theta>pi/2:curve=-curve realpath=np.linspace(a,curve[-1].real,160).astype(complex) ax.plot(realpath.real,realpath.imag,color='#185a9d',lw=2);arrow(ax,realpath) ax.plot([curve[-1].real,curve[-1].real],[0,curve[-1].imag],color='.55',lw=1,ls=':') path=curve[::-1];ax.plot(path.real,path.imag,color='#c4382f',lw=2);arrow(ax,path,index=170,color='#c4382f') ax.text(curve[-1].real,curve[-1].imag+.11,r'$\infty$' if theta