ç¹ç·ã§æ¥åãæãã»ã¾ã¨ã
ã追è¨ã»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 % ç¨åº¦ã®èª¤å·®ã¯ããã¾ãããã ãããåãã§ããã)
㨠ã«ã¯å¤§å°ã®å¶éã¯ç¡ãã®ã§ç¸¦é·ã®æ¥åãæãã¾ãã
ãã¨ãã
æ¨æ¥ä¸æ¨æ¥ã®è¨äºãæ¸ãã¦ãããè²ã ãªæ¹ããã³ã¡ã³ããããã³ããããã ãã¾ããããããã¨ããããã¾ãã
ä»ã¾ã§ä½ããä½ã£ãããè¨äºãæ¸ããããã¦å
¬éãããã¨ã¯ãã£ãããã©ãä»åããã£ãåå¿ã¯ä»ã¾ã§ã§ä¸çªå¤ããã®ã§ããã
ããã¦ãä½ããçºè¡¨ãã¦åå¿ããããåã³ãå¼·ãæãã¾ããã
ããã¯ç ã¿ä»ãã«ãªãããã§ãã
ããããã¦ããªã¼ãã³ã½ã¼ã¹ã§æ´»åãã¦ã人ã®ä¸ã«ã¯ããã®åã³ãåååã«ãã£ã¦ã人ãããã®ããªã? ã¨æã£ããã
ããã§ã¯ããä¼ã¿ãªããã