begin use plotlib: System use elib.optimizer: zeroes_bisection use math: pi, floor, cos extend(System,{ function plot_zero_set(f,argm={}) canvas = self.c wx = self.wx; px = self.px; ax = self.ax wy = self.wy; py = self.py; ay = self.ay px = px-ax*wx py = py-ay*wy {m=10, point = canvas.point, r=0.02, method="bisection"} = argm if method=="bisection" {n=1000} = argm step = wx/n xa = px-wx; xb = px+wx ya = py-wy; yb = py+wy for x in xa..xb: step a = zeroes_bisection(|y| f(x,y),ya,yb,m) for y in a point(canvas;(x-px)/wx,(y-py)/wy) end end for y in ya..yb: step a = zeroes_bisection(|x| f(x,y),xa,xb,m) for x in a point(canvas;(x-px)/wx,(y-py)/wy) end end else {n=400} = argm step = wx/n for y in py-wy..py+wy: step for x in px-wx..px+wx: step if abs(f(x,y))