引理 分段圆弧扩展之后的曲线依然是分段圆弧
from deplete.colloids import *
L, C = Line([0,2], [3,5]), Circle(3, [0,0], [0, pi/2])
subplot(121)
L.draw()
L.extend(0.1).draw()
axis('square');
subplot(122)
C.draw()
C.extend(0.1).draw()
axis('square');
c=triangloid(1, 1, 0.2, -0.4)
c.draw(label='colloid')
title('Naive idea')
for seg in c:
seg.extend(0.1).draw()
axis('equal');
c.draw(label='colloid')
title('Considering Turning points')
c.offset_raw(0.1).draw_each()
axis('equal');
off=linspace(0, 0.4, 5)
for o in off:
c.offset(o).draw(label='Offset {:.1f}'.format(o))
legend(loc="upper right")
axis('equal');
Depletion把两个当成一个整体
import pandas as pd
area=[c.offset(o).area() for o in off]
peri=[c.offset(o).perimeter() for o in off]
pd.DataFrame({"Offset": off, "Area": area, "Perimeter": peri})
Area | Offset | Perimeter | |
---|---|---|---|
0 | 2.423661 | 0.0 | 7.423733 |
1 | 3.170664 | 0.1 | 7.516340 |
2 | 3.926929 | 0.2 | 7.608948 |
3 | 4.699730 | 0.3 | 7.938916 |
4 | 5.521669 | 0.4 | 8.510362 |