ããã°ç§»è»¢ãã¾ãã
ããã§ã!
é£è¼ã®ç¶ããããã§ãã£ã¦ããã¾ã.
ä»å¾ãã©ãããããããé¡ããããã¾ã.
æ¸ãã¦ã¿ã
ã追è¨ãend å¼æ°ã使ãã®ãå¿ãã¦ãã®ã§, ã¡ãã£ã¨ä¿®æ£
@atsuoishimoto ããã«ã¯è² ãã¾ãã.
#!/usr/bin/env python # -*- coding: utf-8 -*- def limit_characters1(s, start, maximum, end=None): """ >>> for i in limit_characters1("12345", 0, 2): ... print(i) 12 34 5 >>> for i in limit_characters1("123456789", 1, 3): ... print(i) 234 567 89 >>> for i in limit_characters1("123456789", 2, 3): ... print(i) 345 678 9 >>> for i in limit_characters1("123456789", 3, 3): ... print(i) 456 789 """ return (s[start + i * maximum:min((end or len(s)), start + (i + 1) * maximum)] \ for i in range(((end or len(s)) - start - 1) / maximum + 1)) def _test(): import doctest doctest.testmod() if __name__ == '__main__': _test()
ãã¿åéä¸
ä»ã®ã¨ãéã¾ã£ã¦ãã®ã
- åè«å ¥éè ã®ããã®ä»£æ°å¦ã®åæ©
- K çè«
- éå¯æ確çè«
- Geometric Invariant Theory
- éåã³ãã¢ãã¸ã¼ã¨ä»£æ°å¹¾ä½ã®é¢ä¿
- Arakelov å¹¾ä½
- å¤å½¢çè«, Torelli ã®å®ç
ã§ã.
2ã¤ç®ä»¥éã¯ã¨ããæ°å¦ã®å¤æ
ãã大好ã㪠follower ããããä¾é ¼ãæ¥ãã®ã§, ãªãã ãéãããªãã®ã°ããã§ã.
èªåã§èãã¦ãããã¿ã¯
- æ¥åæ²ç·ã«ãã RSA ã¸ã®æ»æææ³ã¨æ¥åæ²ç·æå·
- 群ç°ä½åã®åºèª
ã§ã.
ã¤ãã§ã«éçºã®æ¹ã§ãããããã¨ã¨ãã¦ã¯
- bloggart ã¨ããããã°ã¨ã³ã¸ã³ã AppEngine ä¸ã§åããã¦ã¯ã¦ããã移è¡.
- Python ã®ã½ã¼ã¹èªã¿ããã³æ¹é
ã§ã.
çµå±ä½ã«ãããã¨è¨ãã¨, æè¿ Twitter ã®ã¿ã¤ã ã©ã¤ã³ã§ã¡ããã¡ããä¸ãã£ã¦ãåè«ã®å ·ä½ä¾ã¨ãã¦ã®ä»£æ°å¦ã«ã¤ãã¦è©±ããã¨ã«ãããã¨æã£ã¦ãã¾ã.
ããã§ç· ãåã£ãããã§ã¯ãªãã®ã§, ã¾ã ã¾ã åãä»ãã¾ãã(^-^/
ããã§ã¯.
帰ã£ã¦ãã¾ãã.
ã¡ãã£ã¨ç«ã¦è¾¼ãã§ãç¨äºãæ¸ãã§, ã¾ãæéãä½ããããªã®ã§ææ¥ãããããé£è¼ãåéãã¾ã.
é åºã®è©±ã¯ã°ã©ãã®è©±ã«ã¾ã§çºå±ãã¦ã¾ãã, ããç¨åº¦ã®ã¨ããã§åãã¦æ¬¡ã®è©±é¡ã«è¡ãããã¨èãã¦ã¾ã.
ããã§è©±é¡ãåéããããã¨æãã¾ã. 次ã«åãæ±ã£ã¦æ¬²ãã話é¡ãªã©ãããã¾ããã, ãã®è¨äºã«ã³ã¡ã³ããããªã Twitter 㧠Mention ãã ãã. ããã§ã«ãã¼ã®æçµå®çã®è¨¼æã解説ãã¦!ãã¨ããPâ NP ã解ãã¦!ãã¨ãããç¡è¶ãªãã®ã§ãªãéã, ãå¸æã®è©±é¡ãåãä¸ãã¾ã.
ããã§ã¯.
ãã°ãããä¼ã¿
ãé åºã®ã¯ãªãããã°ã©ãã®ã¯ãªãããç¹ç·ã§æ¥åãæããã¨ããããç¶ãç©ã¨ãã¦æ¸ãã¦ãã¾ããã, ç§äºã§2æé ã¾ã§å¿ãããªã£ã¦ãã¾ã£ãã®ã§ãã£ãããä¼ã¿ãã¾ã.
楽ãã¿ã«å¾ ã£ã¦ã人ãããã, çªç¶ä¼ãã§ãã¾ã£ã¦ãã¿ã¾ãã.
ã¾ã2æã®åéã楽ãã¿ã«ãã¦ãã¦ãã ãã.
ã¾ã, ã¾ãçªç¶æ¸ãããããã¾ãããã©ã. æ¥è¨ã®ã¿ã¤ãã«ã©ãã.
ããã§ã¯.
ç¹ç·ã§æ¥åãæãã»ã¾ã¨ã
ã追è¨ã»2011/01/22ãæåã«æ¸ããå 容ã«å¤§å¹ ã«èª¤ãããã£ãã®ã§, å度編éãã¦ãã¾ã. ãã£ã¡ããã¡ããã§ãã¿ã¾ãã.
ã追è¨ã»2011/02/03ãä¿®æ£å®äº. ã½ã¼ã¹ã³ã¼ããè²ã å¤ãã¾ãã.
昨日ã一昨日ã®è¨äºã«ã¯æ°å¼ã«ééãããã£ãã®ã§è¨æ£ããã¾ã¨ãè¨äºãæ¸ãã¾ãã
ãä¿®æ£ã»2013/03/12ãæ°å¼ã«å¯¾ããã³ã¡ã³ãã®éã, ä¿®æ£ãã¾ãã.
æ¥åã®å¼§é·
ã¾ãã ã¨ãã©ã¡ã¼ã¿è¡¨ç¤ºãã¦ãç¹ (a, 0) ããå·¦åãã«å¼§é· ã測ã£ã¦ãããã¨ã«ãã¾ãã
ã¨ãªãããã®éé¢æ° ã®å¾®åãèãã¾ãã(ããã®æç¹ã§å¼ã®å½¢ã«ééããããã¾ããã.)
ãããå·®åå½¢ã«ãã¦ã
㨠ãééãã¦ãã¾ãããã
ãã㧠㨠ã®å¤§å°ã«ã¤ãã¦ã¯ä½ãè¨ã£ã¦ããªããã¨ã«æ³¨æãã¦ãã ããã
ãããå®è£ ãã¾ãã
Python ã½ã¼ã¹ã³ã¼ã
éçºããã¼ã«ã«ãã Github ã«ç§»ããã®ã§, ææ°ã®ã½ã¼ã¹ã¯こちらãè¦ã¦ãã ãã.
import sys import math DIVISION = 1000.0 CYCLE = 10 def angles(du, a, b): phi = 0 while phi <= 2 * math.pi: yield phi phi += du / math.sqrt((a * math.sin(phi))**2 + (b * math.cos(phi))**2) def coordinate(du, a, b): for angle in angles(du, a, b): yield (a * math.cos(angle), b * math.sin(angle)) def circumference(a, b): """Return a length of a circumference of an ellipse. @param a, b length of two semi-axes reference: http://en.wikipedia.org/wiki/Ellipse#Circumference """ expr = ((a - b)/(a + b))**2 return math.pi * (a + b) * (1 + (3 * expr)/(10 + math.sqrt(4 - 3 * expr))) def draw(argv=None): if not argv: argv = sys.argv filename = argv[1] a = float(argv[2]) b = float(argv[3]) du = circumference(a, b) / DIVISION with open(filename, 'w') as out_file: print >> out_file, 'plot "-" w l' print >> out_file, '#x\ty' for i, coord in enumerate(coordinate(du, a, b)): i %= CYCLE * 2 if i < CYCLE: print >> out_file, '{0}\t{1}'.format(*coord) else: print >> out_file, '' print >> out_file, 'end' print >> out_file, 'pause -1' if __name__ == '__main__': draw(sys.argv)
ã³ãã³ã
$ python ellipse.py ellipse.dat 1.0 0.5 gnuplot> plot "ellipse.dat" w l
åºåçµæ
以ä¸ã®ããã«ã¡ããã¨ç¹ç·ãçé·ãçééã§æãã¦ãã¾ãã(å®éã«ããã°ã©ã ã§ç¹ç·ã®é·ãã¨ééã測ã£ãã¨ããã1 % ç¨åº¦ã®èª¤å·®ã¯ããã¾ãããã ãããåãã§ããã)
㨠ã«ã¯å¤§å°ã®å¶éã¯ç¡ãã®ã§ç¸¦é·ã®æ¥åãæãã¾ãã
ãã¨ãã
æ¨æ¥ä¸æ¨æ¥ã®è¨äºãæ¸ãã¦ãããè²ã ãªæ¹ããã³ã¡ã³ããããã³ããããã ãã¾ããããããã¨ããããã¾ãã
ä»ã¾ã§ä½ããä½ã£ãããè¨äºãæ¸ããããã¦å
¬éãããã¨ã¯ãã£ãããã©ãä»åããã£ãåå¿ã¯ä»ã¾ã§ã§ä¸çªå¤ããã®ã§ããã
ããã¦ãä½ããçºè¡¨ãã¦åå¿ããããåã³ãå¼·ãæãã¾ããã
ããã¯ç ã¿ä»ãã«ãªãããã§ãã
ããããã¦ããªã¼ãã³ã½ã¼ã¹ã§æ´»åãã¦ã人ã®ä¸ã«ã¯ããã®åã³ãåååã«ãã£ã¦ã人ãããã®ããªã? ã¨æã£ããã
ããã§ã¯ããä¼ã¿ãªããã
ç¹ç·ã§æ¥åãæãã»ãã®2
[追è¨] ãã®è¨äºã«ã¯èª¤ããå«ã¾ãã¦ãã¾ããè¨æ£ããè¨äºã¯こちらã§ãã
昨日ã®è¨äºã®ç¶ãã§ãã
æ¨æ¥ã¯è¨ç®å¼ã¾ã§ã¯åºããã®ã§ãããå®éã«è¨ç®ããã«ã¯ããããªãã£ãã®ã§ãã£ã¦ã¿ã¾ããã
Numpy ã¨ãããã®ã¯ç¥ã£ã¦ãã®ã§ãããæ¨æºã® Python ã ãã§ã©ãã¾ã§ã§ããããã£ã¦ã¿ã¾ããã
æç»ã¯ gnuplot 使ã£ã¦ãã£ã¦ã¾ãã
ã½ã¼ã¹ã³ã¼ã
ã¡ãã¡ãã£ã¨æ¸ããã®ã§ãã³ã¡ã³ãã¨ãã¯çãã¦ã¾ãã
import sys import math def delta(phi, du, k2): return phi + du / math.sqrt(1 - k2 * math.sin(phi)**2) def draw(argv=None): if not argv: argv = sys.argv filename = argv[1] a = float(argv[2]) b = float(argv[3]) du = float(argv[4]) k2 = 1 - (b/a)**2 phi = 0 with open(filename, 'w') as out_file: print >> out_file, '#x\ty' i = 0 while phi <= 2 * math.pi: i += 1 i %= 10 if i < 5: print >> out_file, '{0}\t{1}'.format(a * math.cos(phi), b * math.sin(phi)) else: print >> out_file, '' phi = delta(phi, du, k2) if __name__ == '__main__': draw(sys.argv)
ã³ãã³ã
$ python ellipse.py ellipse.dat 1.0 0.5 0.01
gnuplot> plot "ellipse.dat" w l
ãã¨ãã
æã£ããã誤差ãçºæ£ããªãã£ãã®ã§æ¥½ã§ããã
ä»æ¥ã°ã£ããã¯ä¿ºã£ã¦ããã¼ã£ã¦æãã¾ãã :P
ããã§ã¯ã