mirror of
http://CODE.RHODECODE.COM/u/O/O/O
synced 2024-11-22 13:48:39 -05:00
67 lines
17 KiB
Python
67 lines
17 KiB
Python
import numpy as ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ
|
||
import plotly.graph_objects as ⵙᔓᔕ𖧷ᑐᑕᗱᗴᒍᒐ8Oⵔ옷ߦᗩᴥᕤᕦⵙⵔⵙⵔⵙᕤᕦᴥᗩߦ옷ⵔO8ᒍᒐᗱᗴᑐᑕ𖧷ᔓᔕⵙ
|
||
from math import *
|
||
import mpmath
|
||
from ipywidgets import interact,widgets,Text,Layout
|
||
from plotly.subplots import make_subplots
|
||
|
||
ⵙᗩᙁᑎᙏᴥOꗳⵙⵔⵙⵔⵙꗳOᴥᙏᑎᙁᗩⵙ=widgets.Text(value='(1-cos(((4)/2)*x))/2',layout=widgets.Layout(width='100%'),description='⚪ᗩ⚪ᙁ⚪ᑎ⚪ᙏ⚪ᴥ⚪Ⓞ⚪ꗳ⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪ꗳ⚪Ⓞ⚪ᴥ⚪ᙏ⚪ᑎ⚪ᙁ⚪ᗩ⚪')
|
||
ⵙᴥᗱᗴᗝꖴᙁᔓᔕⵔ𖧷ᴥᗩ𖧷ᔓᔕⵔᗱᗴᕤᕦИNᗩᴥⵙⵔⵙⵔⵙᴥᗩИNᕤᕦᗱᗴⵔᔓᔕ𖧷ᗩᴥ𖧷ⵔᔓᔕᙁꖴᗝᗱᗴᴥⵙ=widgets.FloatSlider(min=-4*(4*atan(1)),max=4*(4*atan(1)),value=-2*(4*atan(1)),step=(4*atan(1))/4,layout=widgets.Layout(width='100%'),readout_format='.256f',description='⚪ᙏ⚪Ⓞ⚪ᴥ⚪ꗳ⚪◯⚪ᗱᗴ⚪ᕤᕦ⚪ИN⚪ᗩ⚪ᴥ⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪ᴥ⚪ᗩ⚪ИN⚪ᕤᕦ⚪ᗱᗴ⚪◯⚪ꗳ⚪ᴥ⚪Ⓞ⚪ᙏ⚪')
|
||
ⵙᴥᗱᗴᗝꖴᙁᔓᔕⵔᗝИNᗱᗴⵔᗱᗴᕤᕦИNᗩᴥⵙⵔⵙⵔⵙᴥᗩИNᕤᕦᗱᗴⵔᗱᗴИNᗝⵔᔓᔕᙁꖴᗝᗱᗴᴥⵙ=widgets.FloatSlider(min=-4*(4*atan(1)),max=4*(4*atan(1)),value=2*(4*atan(1)),step=(4*atan(1))/4,layout=widgets.Layout(width='100%'),readout_format='.256f',description='⚪Ⓞ⚪✤⚪◯⚪ᗱᗴ⚪ᕤᕦ⚪ИN⚪ᗩ⚪ᴥ⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪ᴥ⚪ᗩ⚪ИN⚪ᕤᕦ⚪ᗱᗴ⚪◯⚪✤⚪Ⓞ⚪')
|
||
ⵙᴥᗱᗴᗝꖴᙁᔓᔕⵔᴥᗱᗴᗯOߦⵔ人𖧷ꖴ𖧷ИNᗩᑎꄍⵔ𖧷ИNꖴOߦⵔⵙⵔⵙߦOꖴИN𖧷ⵔꄍᑎᗩИN𖧷ꖴ𖧷人ⵔߦOᗯᗱᗴᴥⵔᔓᔕᙁꖴᗝᗱᗴᴥⵙ=widgets.IntSlider(min=1,max=16,value=8,layout=widgets.Layout(width='100%'),readout_format='.256f',description='⚪ᴥ⚪ᗱᗴ⚪ᗯ⚪Ⓞ⚪ߦ⚪◯⚪ᴥ⚪ᗱᗴ⚪⚭⚪ᙏ⚪ᑎ⚪ИN⚪◯⚪✤⚪ИN⚪ꖴ⚪Ⓞ⚪ߦ⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪ߦ⚪Ⓞ⚪ꖴ⚪ИN⚪✤⚪◯⚪ИN⚪ᑎ⚪ᙏ⚪⚭⚪ᗱᗴ⚪ᴥ⚪◯⚪ߦ⚪Ⓞ⚪ᗯ⚪ᗱᗴ⚪ᴥ⚪')
|
||
ⵙᴥᗱᗴᗝꖴᙁᔓᔕⵔ·ⵔᗱᗴᙁ8ᗩꖴᴥᗩᗯⵙⵔⵙⵔⵙᗯᗩᴥꖴᗩ8ᙁᗱᗴⵔ·ⵔᔓᔕᙁꖴᗝᗱᗴᴥⵙ=widgets.FloatSlider(min=-2,max=2,value=1,step=1/256,layout=widgets.Layout(width='100%'),readout_format='.256f',description='⚪·⚪◯⚪ᗱᗴ⚪ᙁ⚪⚭⚪ᗩ⚪ꖴ⚪ᴥ⚪ᗩ⚪ᗯ⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪ᗯ⚪ᗩ⚪ᴥ⚪ꖴ⚪ᗩ⚪⚭⚪ᙁ⚪ᗱᗴ⚪◯⚪·⚪')
|
||
ⵙᴥᗱᗴᗝꖴᙁᔓᔕⵔ𑫰ⵔᗱᗴᙁ8ᗩꖴᴥᗩᗯⵙⵔⵙⵔⵙᗯᗩᴥꖴᗩ8ᙁᗱᗴⵔ𑫰ⵔᔓᔕᙁꖴᗝᗱᗴᴥⵙ=widgets.FloatSlider(min=-2,max=2,value=1,step=1/256,layout=widgets.Layout(width='100%'),readout_format='.256f',description='⚪꞉⚪◯⚪ᗱᗴ⚪ᙁ⚪⚭⚪ᗩ⚪ꖴ⚪ᴥ⚪ᗩ⚪ᗯ⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪𖡼⚪ᗯ⚪ᗩ⚪ᴥ⚪ꖴ⚪ᗩ⚪⚭⚪ᙁ⚪ᗱᗴ⚪◯⚪꞉⚪')
|
||
|
||
def ⵙߦᙏᗩᙁᑐᑕⵙⵔⵙⵔⵙᑐᑕᙁᗩᙏߦⵙ(x):return max(min(1,x),-1)
|
||
def ⵙᗱᗴ𖧷ᑎߦᙏOᑐᑕⵙⵔⵙⵔⵙᑐᑕOᙏߦᑎ𖧷ᗱᗴⵙ(ⵙᗩᙁᑎᙏᴥOꗳⵙⵔⵙⵔⵙꗳOᴥᙏᑎᙁᗩⵙ,x,ⵔ·ⵔᗱᗴᙁ8ᗩꖴᴥᗩᗯⵙⵔⵙⵔⵙᗯᗩᴥꖴᗩ8ᙁᗱᗴⵔ·ⵔ,ⵔ𑫰ⵔᗱᗴᙁ8ᗩꖴᴥᗩᗯⵙⵔⵙⵔⵙᗯᗩᴥꖴᗩ8ᙁᗱᗴⵔ𑫰ⵔ):
|
||
ⵙ人ᴥᗩᙁᑎ8ᗩᑐᑕOᗯⵔИNOꖴ𖧷ᑐᑕИNᑎꗳⵙⵔⵙⵔⵙꗳᑎИNᑐᑕ𖧷ꖴOИNⵔᗯOᑐᑕᗩ8ᑎᙁᗩᴥ人ⵙ={ⵙᔓᔕᗱᗴᙏᗩИNⵔИNOꖴ𖧷ᑐᑕИNᑎꗳⵙⵔⵙⵔⵙꗳᑎИNᑐᑕ𖧷ꖴOИNⵔИNᗩᙏᗱᗴᔓᔕⵙ:eval(f'lambda*ⵙᔓᔕ𖧷ИNᗱᗴᙏᑎᕤᕦᴥᗩⵙⵔⵙⵔⵙᗩᴥᕤᕦᑎᙏᗱᗴИN𖧷ᔓᔕⵙ:mpmath.{ⵙᔓᔕᗱᗴᙏᗩИNⵔИNOꖴ𖧷ᑐᑕИNᑎꗳⵙⵔⵙⵔⵙꗳᑎИNᑐᑕ𖧷ꖴOИNⵔИNᗩᙏᗱᗴᔓᔕⵙ}(*ⵙᔓᔕ𖧷ИNᗱᗴᙏᑎᕤᕦᴥᗩⵙⵔⵙⵔⵙᗩᴥᕤᕦᑎᙏᗱᗴИN𖧷ᔓᔕⵙ)') for ⵙᔓᔕᗱᗴᙏᗩИNⵔИNOꖴ𖧷ᑐᑕИNᑎꗳⵙⵔⵙⵔⵙꗳᑎИNᑐᑕ𖧷ꖴOИNⵔИNᗩᙏᗱᗴᔓᔕⵙ in dir(mpmath)}
|
||
return float(eval(ⵙᗩᙁᑎᙏᴥOꗳⵙⵔⵙⵔⵙꗳOᴥᙏᑎᙁᗩⵙ,{'x':x,'ⵙ·ⵔᗱᗴᙁ8ᗩꖴᴥᗩᗯⵙⵔⵙⵔⵙᗯᗩᴥꖴᗩ8ᙁᗱᗴⵔ·ⵙ':ⵔ·ⵔᗱᗴᙁ8ᗩꖴᴥᗩᗯⵙⵔⵙⵔⵙᗯᗩᴥꖴᗩ8ᙁᗱᗴⵔ·ⵔ,'ⵙ𑫰ⵔᗱᗴᙁ8ᗩꖴᴥᗩᗯⵙⵔⵙⵔⵙᗯᗩᴥꖴᗩ8ᙁᗱᗴⵔ𑫰ⵙ':ⵔ𑫰ⵔᗱᗴᙁ8ᗩꖴᴥᗩᗯⵙⵔⵙⵔⵙᗯᗩᴥꖴᗩ8ᙁᗱᗴⵔ𑫰ⵔ,'ⵙߦᙏᗩᙁᑐᑕⵙⵔⵙⵔⵙᑐᑕᙁᗩᙏߦⵙ':ⵙߦᙏᗩᙁᑐᑕⵙⵔⵙⵔⵙᑐᑕᙁᗩᙏߦⵙ,**ⵙ人ᴥᗩᙁᑎ8ᗩᑐᑕOᗯⵔИNOꖴ𖧷ᑐᑕИNᑎꗳⵙⵔⵙⵔⵙꗳᑎИNᑐᑕ𖧷ꖴOИNⵔᗯOᑐᑕᗩ8ᑎᙁᗩᴥ人ⵙ}))
|
||
def ⵙ𖧷OᙁߦⵙⵔⵙⵔⵙߦᙁO𖧷ⵙ(ⵙᗩᙁᑎᙏᴥOꗳⵙⵔⵙⵔⵙꗳOᴥᙏᑎᙁᗩⵙ='1.4795/ⵙ𑫰ⵔᗱᗴᙁ8ᗩꖴᴥᗩᗯⵙⵔⵙⵔⵙᗯᗩᴥꖴᗩ8ᙁᗱᗴⵔ𑫰ⵙ-((x)/(4*atan(1)*ⵙ·ⵔᗱᗴᙁ8ᗩꖴᴥᗩᗯⵙⵔⵙⵔⵙᗯᗩᴥꖴᗩ8ᙁᗱᗴⵔ·ⵙ/2*ⵙ𑫰ⵔᗱᗴᙁ8ᗩꖴᴥᗩᗯⵙⵔⵙⵔⵙᗯᗩᴥꖴᗩ8ᙁᗱᗴⵔ𑫰ⵙ))*1.4795',ⵙ𖧷ᴥᗩ𖧷ᔓᔕⵔᗱᗴᕤᕦИNᗩᴥⵙⵔⵙⵔⵙᴥᗩИNᕤᕦᗱᗴⵔᔓᔕ𖧷ᗩᴥ𖧷ⵙ=-2*(4*atan(1)),ⵙᗝИNᗱᗴⵔᗱᗴᕤᕦИNᗩᴥⵙⵔⵙⵔⵙᴥᗩИNᕤᕦᗱᗴⵔᗱᗴИNᗝⵙ=2*(4*atan(1)),ⵙᴥᗱᗴᗯOߦⵔ人𖧷ꖴ𖧷ИNᗩᑎꄍⵔ𖧷ИNꖴOߦⵔⵙⵔⵙߦOꖴИN𖧷ⵔꄍᑎᗩИN𖧷ꖴ𖧷人ⵔߦOᗯᗱᗴᴥⵙ=8,ⵙ·ⵔᗱᗴᙁ8ᗩꖴᴥᗩᗯⵙⵔⵙⵔⵙᗯᗩᴥꖴᗩ8ᙁᗱᗴⵔ·ⵙ=1,ⵙ𑫰ⵔᗱᗴᙁ8ᗩꖴᴥᗩᗯⵙⵔⵙⵔⵙᗯᗩᴥꖴᗩ8ᙁᗱᗴⵔ𑫰ⵙ=1):
|
||
ⵙ人𖧷ꖴ𖧷ИNᗩᑎꄍⵔ𖧷ИNꖴOߦⵔⵙⵔⵙߦOꖴИN𖧷ⵔꄍᑎᗩИN𖧷ꖴ𖧷人ⵙ=1+2**ⵙᴥᗱᗴᗯOߦⵔ人𖧷ꖴ𖧷ИNᗩᑎꄍⵔ𖧷ИNꖴOߦⵔⵙⵔⵙߦOꖴИN𖧷ⵔꄍᑎᗩИN𖧷ꖴ𖧷人ⵔߦOᗯᗱᗴᴥⵙ
|
||
|
||
ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔꕤⵙⵔⵙⵔⵙꕤⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ=ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.linspace(ⵙ𖧷ᴥᗩ𖧷ᔓᔕⵔᗱᗴᕤᕦИNᗩᴥⵙⵔⵙⵔⵙᴥᗩИNᕤᕦᗱᗴⵔᔓᔕ𖧷ᗩᴥ𖧷ⵙ,ⵙᗝИNᗱᗴⵔᗱᗴᕤᕦИNᗩᴥⵙⵔⵙⵔⵙᴥᗩИNᕤᕦᗱᗴⵔᗱᗴИNᗝⵙ,ⵙ人𖧷ꖴ𖧷ИNᗩᑎꄍⵔ𖧷ИNꖴOߦⵔⵙⵔⵙߦOꖴИN𖧷ⵔꄍᑎᗩИN𖧷ꖴ𖧷人ⵙ)
|
||
|
||
ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔᗩߦᗩ𐊌ⵙⵔⵙⵔⵙ𐊌ᗩߦᗩⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ=ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.array([ⵙᗱᗴ𖧷ᑎߦᙏOᑐᑕⵙⵔⵙⵔⵙᑐᑕOᙏߦᑎ𖧷ᗱᗴⵙ(ⵙᗩᙁᑎᙏᴥOꗳⵙⵔⵙⵔⵙꗳOᴥᙏᑎᙁᗩⵙ,ⵙᗱᗴᑎᙁᗩᗯⵔᗩߦᗩ𐊌ⵙⵔⵙⵔⵙ𐊌ᗩߦᗩⵔᗯᗩᙁᑎᗱᗴⵙ,ⵙ·ⵔᗱᗴᙁ8ᗩꖴᴥᗩᗯⵙⵔⵙⵔⵙᗯᗩᴥꖴᗩ8ᙁᗱᗴⵔ·ⵙ,ⵙ𑫰ⵔᗱᗴᙁ8ᗩꖴᴥᗩᗯⵙⵔⵙⵔⵙᗯᗩᴥꖴᗩ8ᙁᗱᗴⵔ𑫰ⵙ) for ⵙᗱᗴᑎᙁᗩᗯⵔᗩߦᗩ𐊌ⵙⵔⵙⵔⵙ𐊌ᗩߦᗩⵔᗯᗩᙁᑎᗱᗴⵙ in ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔꕤⵙⵔⵙⵔⵙꕤⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ])
|
||
ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔᗩ𖧷ᗱᗴ옷𖧷ⵙⵔⵙⵔⵙ𖧷옷ᗱᗴ𖧷ᗩⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ=ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.cumsum(ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔᗩߦᗩ𐊌ⵙⵔⵙⵔⵙ𐊌ᗩߦᗩⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ)*(ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔꕤⵙⵔⵙⵔⵙꕤⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ[1]-ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔꕤⵙⵔⵙⵔⵙꕤⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ[0]) if ⵙ人𖧷ꖴ𖧷ИNᗩᑎꄍⵔ𖧷ИNꖴOߦⵔⵙⵔⵙߦOꖴИN𖧷ⵔꄍᑎᗩИN𖧷ꖴ𖧷人ⵙ>1 else ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.array([0])
|
||
ⵙⵔᔓᔕᗱᗴ𖧷ᗩИNꖴᗝᴥOᑐᑕⵔꕤⵙⵔⵙⵔⵙꕤⵔᑐᑕOᴥᗝꖴИNᗩ𖧷ᗱᗴᔓᔕⵔⵙ=ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.cumsum(ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.cos(ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔᗩ𖧷ᗱᗴ옷𖧷ⵙⵔⵙⵔⵙ𖧷옷ᗱᗴ𖧷ᗩⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ))*(ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔꕤⵙⵔⵙⵔⵙꕤⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ[1]-ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔꕤⵙⵔⵙⵔⵙꕤⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ[0]) if ⵙ人𖧷ꖴ𖧷ИNᗩᑎꄍⵔ𖧷ИNꖴOߦⵔⵙⵔⵙߦOꖴИN𖧷ⵔꄍᑎᗩИN𖧷ꖴ𖧷人ⵙ>1 else ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.array([0])
|
||
ⵙⵔᔓᔕᗱᗴ𖧷ᗩИNꖴᗝᴥOᑐᑕⵔ人ⵙⵔⵙⵔⵙ人ⵔᑐᑕOᴥᗝꖴИNᗩ𖧷ᗱᗴᔓᔕⵔⵙ=ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.cumsum(ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.sin(ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔᗩ𖧷ᗱᗴ옷𖧷ⵙⵔⵙⵔⵙ𖧷옷ᗱᗴ𖧷ᗩⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ))*(ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔꕤⵙⵔⵙⵔⵙꕤⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ[1]-ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔꕤⵙⵔⵙⵔⵙꕤⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ[0]) if ⵙ人𖧷ꖴ𖧷ИNᗩᑎꄍⵔ𖧷ИNꖴOߦⵔⵙⵔⵙߦOꖴИN𖧷ⵔꄍᑎᗩИN𖧷ꖴ𖧷人ⵙ>1 else ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.array([0])
|
||
|
||
if ⵙⵔᔓᔕᗱᗴ𖧷ᗩИNꖴᗝᴥOᑐᑕⵔꕤⵙⵔⵙⵔⵙꕤⵔᑐᑕOᴥᗝꖴИNᗩ𖧷ᗱᗴᔓᔕⵔⵙ[0] !=0 or ⵙⵔᔓᔕᗱᗴ𖧷ᗩИNꖴᗝᴥOᑐᑕⵔ人ⵙⵔⵙⵔⵙ人ⵔᑐᑕOᴥᗝꖴИNᗩ𖧷ᗱᗴᔓᔕⵔⵙ[0] !=0:
|
||
ⵙᔓᔕᗱᗴ𖧷ᗩИNꖴᗝᴥOᑐᑕⵔꕤⵙⵔⵙⵔⵙꕤⵔᑐᑕOᴥᗝꖴИNᗩ𖧷ᗱᗴᔓᔕⵙ=ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.insert(ⵙⵔᔓᔕᗱᗴ𖧷ᗩИNꖴᗝᴥOᑐᑕⵔꕤⵙⵔⵙⵔⵙꕤⵔᑐᑕOᴥᗝꖴИNᗩ𖧷ᗱᗴᔓᔕⵔⵙ,0,0)
|
||
ⵙᔓᔕᗱᗴ𖧷ᗩИNꖴᗝᴥOᑐᑕⵔ人ⵙⵔⵙⵔⵙ人ⵔᑐᑕOᴥᗝꖴИNᗩ𖧷ᗱᗴᔓᔕⵙ=ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.insert(ⵙⵔᔓᔕᗱᗴ𖧷ᗩИNꖴᗝᴥOᑐᑕⵔ人ⵙⵔⵙⵔⵙ人ⵔᑐᑕOᴥᗝꖴИNᗩ𖧷ᗱᗴᔓᔕⵔⵙ,0,0)
|
||
else:
|
||
ⵙᔓᔕᗱᗴ𖧷ᗩИNꖴᗝᴥOᑐᑕⵔꕤⵙⵔⵙⵔⵙꕤⵔᑐᑕOᴥᗝꖴИNᗩ𖧷ᗱᗴᔓᔕⵙ=ⵙⵔᔓᔕᗱᗴ𖧷ᗩИNꖴᗝᴥOᑐᑕⵔꕤⵙⵔⵙⵔⵙꕤⵔᑐᑕOᴥᗝꖴИNᗩ𖧷ᗱᗴᔓᔕⵔⵙ
|
||
ⵙᔓᔕᗱᗴ𖧷ᗩИNꖴᗝᴥOᑐᑕⵔ人ⵙⵔⵙⵔⵙ人ⵔᑐᑕOᴥᗝꖴИNᗩ𖧷ᗱᗴᔓᔕⵙ=ⵙⵔᔓᔕᗱᗴ𖧷ᗩИNꖴᗝᴥOᑐᑕⵔ人ⵙⵔⵙⵔⵙ人ⵔᑐᑕOᴥᗝꖴИNᗩ𖧷ᗱᗴᔓᔕⵔⵙ
|
||
|
||
ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔ人ⵙⵔⵙⵔⵙ人ⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ=[ⵙᗱᗴ𖧷ᑎߦᙏOᑐᑕⵙⵔⵙⵔⵙᑐᑕOᙏߦᑎ𖧷ᗱᗴⵙ(ⵙᗩᙁᑎᙏᴥOꗳⵙⵔⵙⵔⵙꗳOᴥᙏᑎᙁᗩⵙ,ⵙᗱᗴᑎᙁᗩᗯⵔᗩߦᗩ𐊌ⵙⵔⵙⵔⵙ𐊌ᗩߦᗩⵔᗯᗩᙁᑎᗱᗴⵙ,ⵙ·ⵔᗱᗴᙁ8ᗩꖴᴥᗩᗯⵙⵔⵙⵔⵙᗯᗩᴥꖴᗩ8ᙁᗱᗴⵔ·ⵙ,ⵙ𑫰ⵔᗱᗴᙁ8ᗩꖴᴥᗩᗯⵙⵔⵙⵔⵙᗯᗩᴥꖴᗩ8ᙁᗱᗴⵔ𑫰ⵙ) for ⵙᗱᗴᑎᙁᗩᗯⵔᗩߦᗩ𐊌ⵙⵔⵙⵔⵙ𐊌ᗩߦᗩⵔᗯᗩᙁᑎᗱᗴⵙ in ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔꕤⵙⵔⵙⵔⵙꕤⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ]
|
||
|
||
ⵙᗱᗴᕤᕦИNᗩᴥⵔꕤⵔᙏᑎᙏꖴИNꖴᙏⵙⵔⵙⵔⵙᙏꖴИNꖴᙏᑎᙏⵔꕤⵔᴥᗩИNᕤᕦᗱᗴⵙ=min(map(min,[ⵙᔓᔕᗱᗴ𖧷ᗩИNꖴᗝᴥOᑐᑕⵔꕤⵙⵔⵙⵔⵙꕤⵔᑐᑕOᴥᗝꖴИNᗩ𖧷ᗱᗴᔓᔕⵙ,ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔꕤⵙⵔⵙⵔⵙꕤⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ]))
|
||
ⵙᗱᗴᕤᕦИNᗩᴥⵔ人ⵔᙏᑎᙏꖴИNꖴᙏⵙⵔⵙⵔⵙᙏꖴИNꖴᙏᑎᙏⵔ人ⵔᴥᗩИNᕤᕦᗱᗴⵙ=min(map(min,[ⵙᔓᔕᗱᗴ𖧷ᗩИNꖴᗝᴥOᑐᑕⵔ人ⵙⵔⵙⵔⵙ人ⵔᑐᑕOᴥᗝꖴИNᗩ𖧷ᗱᗴᔓᔕⵙ,ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔ人ⵙⵔⵙⵔⵙ人ⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ]))
|
||
ⵙᗱᗴᕤᕦИNᗩᴥⵔꕤⵔᙏᑎᙏꖴꕤᗩᙏⵙⵔⵙⵔⵙᙏᗩꕤꖴᙏᑎᙏⵔꕤⵔᴥᗩИNᕤᕦᗱᗴⵙ=max(map(max,[ⵙᔓᔕᗱᗴ𖧷ᗩИNꖴᗝᴥOᑐᑕⵔꕤⵙⵔⵙⵔⵙꕤⵔᑐᑕOᴥᗝꖴИNᗩ𖧷ᗱᗴᔓᔕⵙ,ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔꕤⵙⵔⵙⵔⵙꕤⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ]))
|
||
ⵙᗱᗴᕤᕦИNᗩᴥⵔ人ⵔᙏᑎᙏꖴꕤᗩᙏⵙⵔⵙⵔⵙᙏᗩꕤꖴᙏᑎᙏⵔ人ⵔᴥᗩИNᕤᕦᗱᗴⵙ=max(map(max,[ⵙᔓᔕᗱᗴ𖧷ᗩИNꖴᗝᴥOᑐᑕⵔ人ⵙⵔⵙⵔⵙ人ⵔᑐᑕOᴥᗝꖴИNᗩ𖧷ᗱᗴᔓᔕⵙ,ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔ人ⵙⵔⵙⵔⵙ人ⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ]))
|
||
|
||
ⵙ·ⵔᗱᗴᴥᑎᕤᕦꖴꗳⵙⵔⵙⵔⵙꗳꖴᕤᕦᑎᴥᗱᗴⵔ·ⵙ=ⵙᔓᔕ𖧷ᑐᑕᗱᗴᒍᒐ8Oⵔ옷ߦᗩᴥᕤᕦⵙⵔⵙⵔⵙᕤᕦᴥᗩߦ옷ⵔO8ᒍᒐᗱᗴᑐᑕ𖧷ᔓᔕⵙ.Figure()
|
||
ⵙ·ⵔᗱᗴᴥᑎᕤᕦꖴꗳⵙⵔⵙⵔⵙꗳꖴᕤᕦᑎᴥᗱᗴⵔ·ⵙ.add_trace(ⵙᔓᔕ𖧷ᑐᑕᗱᗴᒍᒐ8Oⵔ옷ߦᗩᴥᕤᕦⵙⵔⵙⵔⵙᕤᕦᴥᗩߦ옷ⵔO8ᒍᒐᗱᗴᑐᑕ𖧷ᔓᔕⵙ.Scatter(x=ⵙᔓᔕᗱᗴ𖧷ᗩИNꖴᗝᴥOᑐᑕⵔꕤⵙⵔⵙⵔⵙꕤⵔᑐᑕOᴥᗝꖴИNᗩ𖧷ᗱᗴᔓᔕⵙ,y=ⵙᔓᔕᗱᗴ𖧷ᗩИNꖴᗝᴥOᑐᑕⵔ人ⵙⵔⵙⵔⵙ人ⵔᑐᑕOᴥᗝꖴИNᗩ𖧷ᗱᗴᔓᔕⵙ,mode='lines',line=dict(color='#CECECE'),name='',hovertemplate='ꕤ %{x:.256f}' + '<br>人 %{y:.256f}'))
|
||
ⵙ·ⵔᗱᗴᴥᑎᕤᕦꖴꗳⵙⵔⵙⵔⵙꗳꖴᕤᕦᑎᴥᗱᗴⵔ·ⵙ.update_layout(autosize=True,margin=dict(l=0,r=0,b=0,t=0,pad=0),
|
||
height=512,
|
||
xaxis=dict(scaleanchor='y',scaleratio=1,gridcolor='#CECECE',zeroline=True,zerolinecolor='#CECECE',tickfont=dict(color='#9C9C9C',size=16)),
|
||
yaxis=dict(gridcolor='#CECECE',zeroline=True,zerolinecolor='#CECECE',tickfont=dict(color='#9C9C9C',size=16)),
|
||
hoverlabel=dict(bgcolor="#FFFFFF",font_color='#9C9C9C',bordercolor="#CECECE",font_size=16),plot_bgcolor='#FFFFFF'
|
||
)
|
||
ⵙ·ⵔᗱᗴᴥᑎᕤᕦꖴꗳⵙⵔⵙⵔⵙꗳꖴᕤᕦᑎᴥᗱᗴⵔ·ⵙ.update_xaxes(range=[ⵙᗱᗴᕤᕦИNᗩᴥⵔꕤⵔᙏᑎᙏꖴИNꖴᙏⵙⵔⵙⵔⵙᙏꖴИNꖴᙏᑎᙏⵔꕤⵔᴥᗩИNᕤᕦᗱᗴⵙ,ⵙᗱᗴᕤᕦИNᗩᴥⵔꕤⵔᙏᑎᙏꖴꕤᗩᙏⵙⵔⵙⵔⵙᙏᗩꕤꖴᙏᑎᙏⵔꕤⵔᴥᗩИNᕤᕦᗱᗴⵙ])
|
||
ⵙ·ⵔᗱᗴᴥᑎᕤᕦꖴꗳⵙⵔⵙⵔⵙꗳꖴᕤᕦᑎᴥᗱᗴⵔ·ⵙ.update_yaxes(range=[ⵙᗱᗴᕤᕦИNᗩᴥⵔ人ⵔᙏᑎᙏꖴИNꖴᙏⵙⵔⵙⵔⵙᙏꖴИNꖴᙏᑎᙏⵔ人ⵔᴥᗩИNᕤᕦᗱᗴⵙ,ⵙᗱᗴᕤᕦИNᗩᴥⵔ人ⵔᙏᑎᙏꖴꕤᗩᙏⵙⵔⵙⵔⵙᙏᗩꕤꖴᙏᑎᙏⵔ人ⵔᴥᗩИNᕤᕦᗱᗴⵙ])
|
||
ⵙ·ⵔᗱᗴᴥᑎᕤᕦꖴꗳⵙⵔⵙⵔⵙꗳꖴᕤᕦᑎᴥᗱᗴⵔ·ⵙ.show()
|
||
|
||
ⵙ𑫰ⵔᗱᗴᴥᑎᕤᕦꖴꗳⵙⵔⵙⵔⵙꗳꖴᕤᕦᑎᴥᗱᗴⵔ𑫰ⵙ=ⵙᔓᔕ𖧷ᑐᑕᗱᗴᒍᒐ8Oⵔ옷ߦᗩᴥᕤᕦⵙⵔⵙⵔⵙᕤᕦᴥᗩߦ옷ⵔO8ᒍᒐᗱᗴᑐᑕ𖧷ᔓᔕⵙ.Figure()
|
||
ⵙ𑫰ⵔᗱᗴᴥᑎᕤᕦꖴꗳⵙⵔⵙⵔⵙꗳꖴᕤᕦᑎᴥᗱᗴⵔ𑫰ⵙ.add_trace(ⵙᔓᔕ𖧷ᑐᑕᗱᗴᒍᒐ8Oⵔ옷ߦᗩᴥᕤᕦⵙⵔⵙⵔⵙᕤᕦᴥᗩߦ옷ⵔO8ᒍᒐᗱᗴᑐᑕ𖧷ᔓᔕⵙ.Scatter(x=ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔꕤⵙⵔⵙⵔⵙꕤⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ,y=ⵙᔓᔕᗱᗴᑎᙁᗩᗯⵔ人ⵙⵔⵙⵔⵙ人ⵔᗯᗩᙁᑎᗱᗴᔓᔕⵙ,mode='lines',line=dict(color='#CECECE'),name='',hovertemplate='ꕤ %{x:.256f}' + '<br>人 %{y:.256f}'))
|
||
ⵙ𑫰ⵔᗱᗴᴥᑎᕤᕦꖴꗳⵙⵔⵙⵔⵙꗳꖴᕤᕦᑎᴥᗱᗴⵔ𑫰ⵙ.update_layout(autosize=True,margin=dict(l=0,r=0,b=0,t=0,pad=0),
|
||
height=512,
|
||
xaxis=dict(scaleanchor='y',scaleratio=1,gridcolor='#CECECE',zeroline=True,zerolinecolor='#CECECE',tickfont=dict(color='#9C9C9C',size=16)),
|
||
yaxis=dict(gridcolor='#CECECE',zeroline=True,zerolinecolor='#CECECE',tickfont=dict(color='#9C9C9C',size=16)),
|
||
hoverlabel=dict(bgcolor="#FFFFFF",font_color='#9C9C9C',bordercolor="#CECECE",font_size=16),plot_bgcolor='#FFFFFF'
|
||
)
|
||
ⵙ𑫰ⵔᗱᗴᴥᑎᕤᕦꖴꗳⵙⵔⵙⵔⵙꗳꖴᕤᕦᑎᴥᗱᗴⵔ𑫰ⵙ.update_xaxes(range=[ⵙᗱᗴᕤᕦИNᗩᴥⵔꕤⵔᙏᑎᙏꖴИNꖴᙏⵙⵔⵙⵔⵙᙏꖴИNꖴᙏᑎᙏⵔꕤⵔᴥᗩИNᕤᕦᗱᗴⵙ,ⵙᗱᗴᕤᕦИNᗩᴥⵔꕤⵔᙏᑎᙏꖴꕤᗩᙏⵙⵔⵙⵔⵙᙏᗩꕤꖴᙏᑎᙏⵔꕤⵔᴥᗩИNᕤᕦᗱᗴⵙ])
|
||
ⵙ𑫰ⵔᗱᗴᴥᑎᕤᕦꖴꗳⵙⵔⵙⵔⵙꗳꖴᕤᕦᑎᴥᗱᗴⵔ𑫰ⵙ.update_yaxes(range=[ⵙᗱᗴᕤᕦИNᗩᴥⵔ人ⵔᙏᑎᙏꖴИNꖴᙏⵙⵔⵙⵔⵙᙏꖴИNꖴᙏᑎᙏⵔ人ⵔᴥᗩИNᕤᕦᗱᗴⵙ,ⵙᗱᗴᕤᕦИNᗩᴥⵔ人ⵔᙏᑎᙏꖴꕤᗩᙏⵙⵔⵙⵔⵙᙏᗩꕤꖴᙏᑎᙏⵔ人ⵔᴥᗩИNᕤᕦᗱᗴⵙ])
|
||
ⵙ𑫰ⵔᗱᗴᴥᑎᕤᕦꖴꗳⵙⵔⵙⵔⵙꗳꖴᕤᕦᑎᴥᗱᗴⵔ𑫰ⵙ.show()
|
||
|
||
interact(ⵙ𖧷OᙁߦⵙⵔⵙⵔⵙߦᙁO𖧷ⵙ,ⵙᗩᙁᑎᙏᴥOꗳⵙⵔⵙⵔⵙꗳOᴥᙏᑎᙁᗩⵙ=ⵙᗩᙁᑎᙏᴥOꗳⵙⵔⵙⵔⵙꗳOᴥᙏᑎᙁᗩⵙ,ⵙ𖧷ᴥᗩ𖧷ᔓᔕⵔᗱᗴᕤᕦИNᗩᴥⵙⵔⵙⵔⵙᴥᗩИNᕤᕦᗱᗴⵔᔓᔕ𖧷ᗩᴥ𖧷ⵙ=ⵙᴥᗱᗴᗝꖴᙁᔓᔕⵔ𖧷ᴥᗩ𖧷ᔓᔕⵔᗱᗴᕤᕦИNᗩᴥⵙⵔⵙⵔⵙᴥᗩИNᕤᕦᗱᗴⵔᔓᔕ𖧷ᗩᴥ𖧷ⵔᔓᔕᙁꖴᗝᗱᗴᴥⵙ,ⵙᗝИNᗱᗴⵔᗱᗴᕤᕦИNᗩᴥⵙⵔⵙⵔⵙᴥᗩИNᕤᕦᗱᗴⵔᗱᗴИNᗝⵙ=ⵙᴥᗱᗴᗝꖴᙁᔓᔕⵔᗝИNᗱᗴⵔᗱᗴᕤᕦИNᗩᴥⵙⵔⵙⵔⵙᴥᗩИNᕤᕦᗱᗴⵔᗱᗴИNᗝⵔᔓᔕᙁꖴᗝᗱᗴᴥⵙ,ⵙᴥᗱᗴᗯOߦⵔ人𖧷ꖴ𖧷ИNᗩᑎꄍⵔ𖧷ИNꖴOߦⵔⵙⵔⵙߦOꖴИN𖧷ⵔꄍᑎᗩИN𖧷ꖴ𖧷人ⵔߦOᗯᗱᗴᴥⵙ=ⵙᴥᗱᗴᗝꖴᙁᔓᔕⵔᴥᗱᗴᗯOߦⵔ人𖧷ꖴ𖧷ИNᗩᑎꄍⵔ𖧷ИNꖴOߦⵔⵙⵔⵙߦOꖴИN𖧷ⵔꄍᑎᗩИN𖧷ꖴ𖧷人ⵔߦOᗯᗱᗴᴥⵔᔓᔕᙁꖴᗝᗱᗴᴥⵙ,ⵙ·ⵔᗱᗴᙁ8ᗩꖴᴥᗩᗯⵙⵔⵙⵔⵙᗯᗩᴥꖴᗩ8ᙁᗱᗴⵔ·ⵙ=ⵙᴥᗱᗴᗝꖴᙁᔓᔕⵔ·ⵔᗱᗴᙁ8ᗩꖴᴥᗩᗯⵙⵔⵙⵔⵙᗯᗩᴥꖴᗩ8ᙁᗱᗴⵔ·ⵔᔓᔕᙁꖴᗝᗱᗴᴥⵙ,ⵙ𑫰ⵔᗱᗴᙁ8ᗩꖴᴥᗩᗯⵙⵔⵙⵔⵙᗯᗩᴥꖴᗩ8ᙁᗱᗴⵔ𑫰ⵙ=ⵙᴥᗱᗴᗝꖴᙁᔓᔕⵔ𑫰ⵔᗱᗴᙁ8ᗩꖴᴥᗩᗯⵙⵔⵙⵔⵙᗯᗩᴥꖴᗩ8ᙁᗱᗴⵔ𑫰ⵔᔓᔕᙁꖴᗝᗱᗴᴥⵙ); |