gradient - How to walk along all points on a line in python -
i have function has line of zeros. (imagine f(x)=(sin(x)/x)^2), don't know line or shape takes, can trivially find point on line minimizing f(x); once i've found 1 point on line of zeros, want map out line making small steps, until end of line, or start:
from numpy import sin math import pi def f(x,y): r=(x**2+y**2)**0.5 return (sin(r)/r)**2 x0=pi y0=0
now how trace line of x,y corresponds f(x,y)=0 (in case circle, radius pi, in case shape , position not analytic)?
Comments
Post a Comment