{"id":209550,"date":"2014-02-06T00:32:03","date_gmt":"2014-02-05T20:32:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=209550"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=209550","title":{"rendered":"<span class=\"post_title\">\u041a\u0440\u0443\u0433\u043b\u0435\u043d\u0434\u0430\u0440\u044c \u043d\u0430 2014 \u0433\u043e\u0434<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/cad\/cad\/e6b\/cadcade6b286c4e62beb696d3904408b.png\"\/><\/p>\n<p>  \u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u0434\u0440\u0443\u0437\u044c\u044f!<br \/>  \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0433\u043e\u0434\u0443 \u044f \u0441\u043b\u0435\u0434\u0430\u043b <a href=\"http:\/\/habrahabr.ru\/post\/168697\/\">\u043f\u0435\u0440\u0432\u044b\u0439 \u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0434\u0430\u0440\u044c<\/a>.<br \/>  \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c, \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c.<\/p>\n<p>  \u0418\u0434\u0435\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u2014 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044c, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432\u0441\u0435 \u0434\u043d\u0438 \u0433\u043e\u0434\u0430, \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e.<br \/>  \u0415\u0441\u0442\u044c <a href=\"https:\/\/www.google.ru\/search?q=round+calendar&amp;newwindow=1&amp;tbm=isch&amp;tbo=u&amp;source=univ&amp;sa=X&amp;ei=OafyUqLnAuWvyAOwrYGoAw&amp;ved=0CCUQsAQ&amp;biw=1920&amp;bih=936\">\u043a\u0443\u0447\u0430 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432<\/a>, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u0442\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u0438 \u043f\u0443\u0441\u0442\u043e\u0442\u0430, \u0432\u0435\u0434\u044c \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u043b\u0430\u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043a\u0430\u0440\u0430\u043a\u0443\u043b\u0438 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044f.<\/p>\n<p>  \u2022 <a href=\"https:\/\/github.com\/illus0r\/kruglendar2014\/\">\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0441 Github<\/a> (\u0438\u043b\u0438 <i>git clone <a href=\"https:\/\/github.com\/illus0r\/kruglendar2014.git\">github.com\/illus0r\/kruglendar2014.git<\/a><\/i>)<br \/>  \u2022 \u0420\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043d\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u04101<br \/>  \u2022 \u0412\u0435\u0448\u0430\u0435\u043c \u043d\u0430 \u0441\u0442\u0435\u043d\u043a\u0443 \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 (\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u2014 \u0432 \u0442\u0443\u0430\u043b\u0435\u0442\u0435), \u0440\u044f\u0434\u043e\u043c \u2014 \u0444\u043b\u043e\u043c\u0430\u0441\u0442\u0435\u0440 \u043d\u0430 \u043d\u0438\u0442\u043e\u0447\u043a\u0435. <br \/>  \u2022 \u0421\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0447\u0442\u043e-\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435? \u041b\u0438\u0445\u043e \u0434\u043e\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0434\u0430\u0440\u044c! \u041a \u043a\u043e\u043d\u0446\u0443 \u0433\u043e\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u043b\u044e\u0431\u043e-\u0434\u043e\u0440\u043e\u0433\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c.<\/p>\n<p>  <a rel=\"license\" href=\"http:\/\/creativecommons.org\/licenses\/by\/3.0\/deed.ru\"><img decoding=\"async\" alt=\"\u041b\u0438\u0446\u0435\u043d\u0437\u0438\u044f Creative Commons\" src=\"http:\/\/habr.habrastorage.org\/post_images\/134\/521\/05a\/13452105acc9cb47b5c27a6d553855c0.png\"\/><\/a><br \/>  \u0422\u0430\u043a\u0436\u0435, \u043a\u0430\u043a \u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439, \u044d\u0442\u043e\u0442 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044c \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0434 <a href=\"http:\/\/creativecommons.org\/licenses\/by\/3.0\/deed.ru\">\u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439 Creative Commons \u00abAttribution\u00bb (\u00ab\u0410\u0442\u0440\u0438\u0431\u0443\u0446\u0438\u044f\u00bb) 3.0 \u041d\u0435\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439.<\/a><\/p>\n<p>  \u0421 \u041d\u043e\u0432\u044b\u043c \u0413\u043e\u0434\u043e\u043c!<\/p>\n<p>  \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041f\u0440\u043e\u0446\u0435\u0441\u0441<\/h4>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0433\u043e\u0434\u0443 \u0432\u0441\u0451 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0441 \u043d\u0430\u0431\u0440\u043e\u0441\u043a\u043e\u0432. \u0414\u0443\u043c\u0430\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u0430\u0432\u043e\u0440\u043e\u0447\u0435\u043d\u043d\u043e\u0435 \u0438 \u0444\u0440\u0430\u043a\u0442\u0430\u043b\u044c\u043d\u043e\u0435, \u0441 \u043b\u0443\u043d\u043d\u044b\u043c \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0451\u043c \u0432 \u0434\u043e\u0432\u0435\u0441\u043e\u043a. \u041d\u043e \u0432\u0435\u0440\u043d\u0443\u043b\u0441\u044f \u043a \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u043e\u043c\u0443 \u044d\u0441\u043a\u0438\u0437\u0443.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/2ec\/775\/8f9\/2ec7758f991d215d854f8a9492caf65f.png\"\/> <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/6ec\/15e\/bb7\/6ec15ebb70db7c9538b52bf8924ae1c2.png\"\/><\/p>\n<p>  \u041a\u0430\u043a \u0437\u0430\u043f\u0440\u0430\u0432\u0441\u043a\u0438\u0439 \u043b\u0435\u043d\u0442\u044f\u0439, \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043b\u044c\u0432\u0438\u043d\u0443\u044e \u0434\u043e\u043b\u044e \u0440\u0430\u0431\u043e\u0442\u044b. \u0422\u0430\u043a \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u043c\u0438, \u0442\u043e\u043b\u0449\u0438\u043d\u0430\u043c\u0438 \u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0448\u0440\u0438\u0444\u0442\u0430\u043c\u0438.<\/p>\n<p>  \u0421\u043f\u0435\u0440\u0432\u0430 \u0437\u0430\u0434\u0430\u0432\u0430\u043b \u0440\u0430\u0434\u0438\u0443\u0441\u044b \u0438 \u0442\u043e\u043b\u0449\u0438\u043d\u044b \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u043d\u043e \u043f\u043e\u0442\u043e\u043c \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0435\u0435 \u0438 \u043f\u0440\u0438\u044f\u0442\u043d\u0435\u0435, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c\u0441\u044f \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0438\u0435\u0439.<\/p>\n<p>  \u041d\u0430\u0434 \u0446\u0432\u0435\u0442\u0430\u043c\u0438 \u0434\u043e\u043b\u0433\u043e \u043d\u0435 \u0434\u0443\u043c\u0430\u043b. \u0412 \u0444\u043e\u0442\u043e\u0448\u043e\u043f\u0435, \u043e\u0442\u043a\u0440\u044b\u043b \u043e\u043a\u043e\u0448\u043a\u043e \u0432\u044b\u0431\u043e\u0440\u0430 \u0446\u0432\u0435\u0442\u0430 \u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u043b\u0441\u044f \u0432 \u0440\u0435\u0436\u0438\u043c \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 Lightness \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0439 \u0441\u0445\u0435\u043c\u044b Lab (\u043e\u043d\u0430 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u0435 \u0446\u0432\u0435\u0442\u0430 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u043c \u0438 \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0446\u0432\u0435\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0441\u0445\u043e\u0436\u0435\u0439).<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/348\/1ba\/4b2\/3481ba4b21c8421d55d33c75a6b6c703.png\"\/><\/p>\n<p>  \u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0447\u0435\u043a \u0435\u0441\u0442\u044c, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0443\u0442\u0451\u043c \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438. \u0425\u043e\u0440\u043e\u0448\u043e, \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0443\u0442\u044c, \u0438 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u043c\u0430\u0441\u043a\u043e\u0439 \u0432 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0435. \u041d\u043e \u0432\u0435\u0434\u044c \u0442\u0430\u043a \u0432\u0435\u0441\u0435\u043b\u0435\u0435!<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u0430\u043c\u043e\u0451 \u0441\u043a\u0440\u0438\u043f\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># -*- coding: utf-8 -*- import svgwrite, math, numpy  def frange(x, y, jump):   while x &lt; y:     yield x     x += jump  if __name__ == '__main__':   # Calendar parameters   textAngleShift = -(0.26*math.pi*2\/365)   canvasSize = (500,707)   mid = canvasSize[0]\/2.0, canvasSize[1]\/2.0   dayFontFamily = &quot;PT Sans&quot;   dayFontSize = &quot;1.8pt&quot;   svgFileName = 'calendar_03.svg'    # we will interpolate rainbow gradient through these points   rainbowGradient = [[  0,  0,  0,239,255,255,  0,  0],  # Red              [254,248,246,194,  0,  0,211,254],  # Green              [255,193,  0,  0,  0,210,255,255]]  # Blue   rainbowGradientPoints = [math.pi*2\/7*0,                math.pi*2\/7*1,                math.pi*2\/7*2,                math.pi*2\/7*3,                math.pi*2\/7*4,                math.pi*2\/7*5,                math.pi*2\/7*6,                math.pi*2\/7*7               ]    #=======================================   # Calendar circle parameters   #=======================================   k = 3.0 # multiplication koef.   delta = 1.9 # first step in progression   initRad = canvasSize[0]*0.3684 # initial size   radiusProgression = [initRad]   for i in range(4):     nextValue = initRad-delta*pow(k,i)     radiusProgression += [nextValue]   R_dates = 1.2*canvasSize[0]*0.312   R_days_end, \\     R_days_beg, \\     R_weeks_beg, \\     R_mounthes_beg, \\     R_seasons_beg = radiusProgression   #R_weekend_end = R_days_beg + 20;   R_weekend_end = R_days_end;   # Stroke width   stroke_k = 1.8   stroke_thinest = 0.15   dayLineStrokeWidth, \\     weekLineStrokeWidth, \\     mounthLineStrokeWidth, \\     seasonLineStrokeWidth = [0.1*(stroke_k**i) for i in range(4,0,-1)]    weekendStrokeWidth = 6.7    #=======================================   # Filling mounth arrays   #=======================================   dayAngle = math.pi*2\/365   weekAngle = dayAngle*7   mounthes = [u'\u044f\u043d\u0432\u0430\u0440\u044f',\\         u'\u0444\u0435\u0432\u0440\u0430\u043b\u044f',\\         u'\u043c\u0430\u0440\u0442\u0430',\\         u'\u0430\u043f\u0440\u0435\u043b\u044f',\\         u'\u043c\u0430\u044f',\\         u'\u0438\u044e\u043d\u044f',\\         u'\u0438\u044e\u043b\u044f',\\         u'\u0430\u0432\u0433\u0443\u0441\u0442\u0430',\\         u'\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f',\\         u'\u043e\u043a\u0442\u044f\u0431\u0440\u044f',\\         u'\u043d\u043e\u044f\u0431\u0440\u044f',\\         u'\u0434\u0435\u043a\u0430\u0431\u0440\u044f'\\         ]   mounthDays = [31,28,31,30,31,30,31,31,30,31,30,31] # days in each mounth   yearDays = [&quot;%d %s&quot;%(i+1, mounthes[index]) \\             for index, m in enumerate(mounthDays) \\             for i in range(m)]   # array with marks for yearDays:   # 1 means first day of mounth   # 2 means first day of mounth and of season   allFirstDates = [ 0 if i!=0 else \\             1 if (index+1)%3!=0 else \\             2 \\             for index, m in enumerate(mounthDays) \\             for i in range(m)]   mounthAngles = [d*dayAngle for d in mounthDays]    #=======================================   # Making svg and groups   #=======================================   dwg = svgwrite.Drawing(svgFileName, profile='tiny')    textGroup = dwg.g(font_family=dayFontFamily, \\      font_size=dayFontSize,\\      text_anchor=&quot;start&quot; )   dayLineGroup = dwg.g(stroke_width=dayLineStrokeWidth, fill='none')   weekLineGroup = dwg.g(stroke_width=weekLineStrokeWidth, fill='none')   mounthLineGroup = dwg.g(stroke_width=mounthLineStrokeWidth, fill='none')   seasonLineGroup = dwg.g(stroke_width=seasonLineStrokeWidth, fill='none')   weekendGroup = dwg.g(stroke_width=weekendStrokeWidth, fill='none')    #=======================================   # Drawing in defined groups   #=======================================   for index, angle in enumerate(frange(0,math.pi*2,dayAngle)):     # interpolation will help us to find     # all necessary segments for every segment of circles     colorTuple = (int(numpy.interp(angle, rainbowGradientPoints, \\             rainbowGradient[0])), \\            int(numpy.interp(angle, rainbowGradientPoints, \\            rainbowGradient[1])), \\            int(numpy.interp(angle, rainbowGradientPoints, \\            rainbowGradient[2])))     color = &quot;rgb%s&quot;%(str(colorTuple))     sinus =   math.sin(angle)     cosinus = math.cos(angle)          # Draw a week segment     if (index-5)%7 == 0:       weekLineGroup.add (dwg.line( (mid[0]-R_weeks_beg*sinus, \\          mid[1]+R_weeks_beg*cosinus), \\          (mid[0]-R_days_beg *sinus,mid[1]+R_days_beg *cosinus), \\          stroke=color) )       # Draw a weekend       sinus_weekend   = math.sin(angle-dayAngle)       cosinus_weekend = math.cos(angle-dayAngle)       weekendGroup.add (dwg.line( (mid[0]-R_days_beg*sinus_weekend, \\          mid[1]+R_days_beg*cosinus_weekend), \\          (mid[0]-R_weekend_end *sinus_weekend,mid[1]+R_weekend_end *\\          cosinus_weekend), \\          stroke=color) )     #if (index-)       weekLineGroup.add (dwg.line( (mid[0]-R_weeks_beg*sinus, \\               mid[1]+R_weeks_beg*cosinus), \\          (mid[0]-R_days_beg *sinus,mid[1]+R_days_beg *cosinus), \\          stroke=color) )     # Draw a mounth+season segments     if allFirstDates[index]!=0:       mounthLineGroup.add (dwg.line( (mid[0]-R_mounthes_beg*sinus,mid[1]+\\               R_mounthes_beg*cosinus), \\          (mid[0]-R_weeks_beg *sinus,mid[1]+R_weeks_beg*cosinus), \\          stroke=color) )       # Draw a season segments       if allFirstDates[index]==2:         seasonLineGroup.add (dwg.line( (mid[0]-R_seasons_beg*sinus,mid[1]+\\                 R_seasons_beg*cosinus), \\            (mid[0]-R_mounthes_beg *sinus,mid[1]+R_mounthes_beg*cosinus), \\            stroke=color) )     # Draw a day segments     dayLineGroup.add (dwg.line( (mid[0]-R_days_beg*sinus,mid[1]+\\             R_days_beg*cosinus), \\        (mid[0]-R_days_end *sinus,mid[1]+R_days_end *cosinus), \\        stroke=color        ) )      # Draw a day name     if (index-4)%7 == 0 or (index-3)%7 == 0:         fillColor = color #&quot;rgb(255,255,255)&quot;         #fontWeight = &quot;bold&quot;         weekendMargin = 2.0     else:         fillColor = &quot;rgb(0,0,0)&quot;         #fontWeight = &quot;normal&quot;         weekendMargin = 0     wordGroup = dwg.g(transform=&quot;rotate(%f, %f, %f) translate(%f,0)&quot; \\             %( math.degrees(angle+dayAngle+textAngleShift)+90, \\             mid[0], mid[1], +R_dates+weekendMargin ) \\             )     wordGroup.add( dwg.text( '%s'%(yearDays[index]), \\             insert=mid, fill=fillColor \\             #,style=&quot;font-weight: %s;&quot;%(fontWeight)             ))     textGroup.add(wordGroup)      #=======================================     # Dray a circle segments     #=======================================     sinus_end =   math.sin(angle+dayAngle)     cosinus_end = math.cos(angle+dayAngle)     dayLineGroup.add( dwg.line( (mid[0]-R_days_beg*sinus,  \\             mid[1]+R_days_beg*cosinus), \\       (mid[0]-R_days_beg*sinus_end,mid[1]+R_days_beg*cosinus_end), \\       stroke=color ) )     weekLineGroup.add( dwg.line((mid[0]-R_weeks_beg*sinus,    \\             mid[1]+R_weeks_beg*cosinus), \\       (mid[0]-R_weeks_beg*sinus_end,mid[1]+R_weeks_beg*cosinus_end), \\       stroke=color ) )     mounthLineGroup.add( dwg.line((mid[0]-R_mounthes_beg*sinus,   \\             mid[1]+R_mounthes_beg*cosinus), \\       (mid[0]-R_mounthes_beg*sinus_end,mid[1]+R_mounthes_beg*cosinus_end), \\       stroke=color ) )     seasonLineGroup.add( dwg.line((mid[0]-R_seasons_beg*sinus,    \\             mid[1]+R_seasons_beg*cosinus), \\       (mid[0]-R_seasons_beg*sinus_end,mid[1]+R_seasons_beg*cosinus_end), \\       stroke=color ) )    #=======================================   # Simple circles for quick testing   #=======================================   #dayLineGroup.add( dwg.circle(center=mid, r=R_days_end, stroke='black' ) )   #dayLineGroup.add( dwg.circle(center=mid, r=R_days_beg, stroke='black' ) )   #weekLineGroup.add( dwg.circle(center=mid, r=R_weeks_beg, stroke='black' ) )   #mounthLineGroup.add( dwg.circle(center=mid, r=R_mounthes_beg, stroke='black' ) )   #seasonLineGroup.add( dwg.circle(center=mid, r=R_seasons_beg, stroke='black') )    dwg.add(dayLineGroup)   dwg.add(weekLineGroup)   dwg.add(mounthLineGroup)   dwg.add(seasonLineGroup)   dwg.add(weekendGroup)   dwg.add(textGroup)    # As I didn't learn how to set document width and height, just draw a rect   dwg.add(dwg.rect((0, 0), canvasSize, stroke='gray', fill=&quot;none&quot;))    dwg.add(dwg.text(&quot;2014&quot;, insert=(mid[0],mid[1]+4), \\           text_anchor=&quot;middle&quot;, font_family=&quot;PT Serif&quot;, font_size=&quot;10pt&quot;))    #=======================================   # Finaly, draw it!   #=======================================   dwg.save() <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c <a href=\"https:\/\/raw.github.com\/illus0r\/kruglendar2014\/master\/calendar_03.svg\">\u0442\u0430\u043a\u043e\u0439 \u0432\u043e\u0442 SVG \u0444\u0430\u0439\u043b<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0441\u043b\u0435\u0433\u043a\u0430 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c <s>\u043d\u0430\u043f\u0438\u043b\u044c\u043d\u0438\u043a\u043e\u043c<\/s> \u0432 \u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0435. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u0434\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u04101, \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u0435\u0440\u043d\u0438\u043d\u0433 \u0447\u0438\u0441\u043b\u0430 2014, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0430\u043f\u0440\u043e\u0448\u0438 \u0432 \u043c\u0435\u043b\u043a\u0438\u0445 \u043d\u0430\u0434\u043f\u0438\u0441\u044f\u0445, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u043d\u0438\u0437\u0443 \u043f\u043e\u0434\u043f\u0438\u0441\u044c.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/de3\/1ce\/708\/de31ce70894833c968d19909edfdc669.png\"\/><\/p>\n<p>  \u041e\u043f-\u043b\u044f! \u041a\u0440\u0443\u0433\u043b\u0435\u043d\u0434\u0430\u0440\u044c \u0433\u043e\u0442\u043e\u0432. \u0414\u0435\u043b\u0430\u0435\u043c <a href=\"http:\/\/vk.com\/kruglendar\">\u0433\u0440\u0443\u043f\u043f\u0443 \u0432 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0435<\/a> \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438, \u043f\u0438\u0448\u0435\u043c \u0440\u0438\u0434\u043c\u0438 \u0434\u043b\u044f <a href=\"https:\/\/github.com\/illus0r\/kruglendar2014\">\u0413\u0438\u0442\u0445\u0430\u0431\u0430<\/a> \u0438 \u0441\u0442\u0430\u0442\u044c\u044e \u043d\u0430 \u0425\u0430\u0431\u0440.<\/p>\n<p>  \u0412\u0441\u0435\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0431\u0443\u0434\u0443 \u0440\u0430\u0434 \u0432\u0430\u0448\u0438\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/209550\/\"> http:\/\/habrahabr.ru\/post\/209550\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/cad\/cad\/e6b\/cadcade6b286c4e62beb696d3904408b.png\"\/><\/p>\n<p>  \u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u0434\u0440\u0443\u0437\u044c\u044f!<br \/>  \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0433\u043e\u0434\u0443 \u044f \u0441\u043b\u0435\u0434\u0430\u043b <a href=\"http:\/\/habrahabr.ru\/post\/168697\/\">\u043f\u0435\u0440\u0432\u044b\u0439 \u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0434\u0430\u0440\u044c<\/a>.<br \/>  \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c, \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c.<\/p>\n<p>  \u0418\u0434\u0435\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u2014 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044c, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432\u0441\u0435 \u0434\u043d\u0438 \u0433\u043e\u0434\u0430, \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e.<br \/>  \u0415\u0441\u0442\u044c <a href=\"https:\/\/www.google.ru\/search?q=round+calendar&amp;newwindow=1&amp;tbm=isch&amp;tbo=u&amp;source=univ&amp;sa=X&amp;ei=OafyUqLnAuWvyAOwrYGoAw&amp;ved=0CCUQsAQ&amp;biw=1920&amp;bih=936\">\u043a\u0443\u0447\u0430 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432<\/a>, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u0442\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u0438 \u043f\u0443\u0441\u0442\u043e\u0442\u0430, \u0432\u0435\u0434\u044c \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u043b\u0430\u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043a\u0430\u0440\u0430\u043a\u0443\u043b\u0438 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044f.<\/p>\n<p>  \u2022 <a href=\"https:\/\/github.com\/illus0r\/kruglendar2014\/\">\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0441 Github<\/a> (\u0438\u043b\u0438 <i>git clone <a href=\"https:\/\/github.com\/illus0r\/kruglendar2014.git\">github.com\/illus0r\/kruglendar2014.git<\/a><\/i>)<br \/>  \u2022 \u0420\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043d\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u04101<br \/>  \u2022 \u0412\u0435\u0448\u0430\u0435\u043c \u043d\u0430 \u0441\u0442\u0435\u043d\u043a\u0443 \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 (\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u2014 \u0432 \u0442\u0443\u0430\u043b\u0435\u0442\u0435), \u0440\u044f\u0434\u043e\u043c \u2014 \u0444\u043b\u043e\u043c\u0430\u0441\u0442\u0435\u0440 \u043d\u0430 \u043d\u0438\u0442\u043e\u0447\u043a\u0435. <br \/>  \u2022 \u0421\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0447\u0442\u043e-\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435? \u041b\u0438\u0445\u043e \u0434\u043e\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0434\u0430\u0440\u044c! \u041a \u043a\u043e\u043d\u0446\u0443 \u0433\u043e\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u043b\u044e\u0431\u043e-\u0434\u043e\u0440\u043e\u0433\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c.<\/p>\n<p>  <a rel=\"license\" href=\"http:\/\/creativecommons.org\/licenses\/by\/3.0\/deed.ru\"><img decoding=\"async\" alt=\"\u041b\u0438\u0446\u0435\u043d\u0437\u0438\u044f Creative Commons\" src=\"http:\/\/habr.habrastorage.org\/post_images\/134\/521\/05a\/13452105acc9cb47b5c27a6d553855c0.png\"\/><\/a><br \/>  \u0422\u0430\u043a\u0436\u0435, \u043a\u0430\u043a \u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439, \u044d\u0442\u043e\u0442 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044c \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0434 <a href=\"http:\/\/creativecommons.org\/licenses\/by\/3.0\/deed.ru\">\u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439 Creative Commons \u00abAttribution\u00bb (\u00ab\u0410\u0442\u0440\u0438\u0431\u0443\u0446\u0438\u044f\u00bb) 3.0 \u041d\u0435\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439.<\/a><\/p>\n<p>  \u0421 \u041d\u043e\u0432\u044b\u043c \u0413\u043e\u0434\u043e\u043c!<\/p>\n<p>  \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-209550","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/209550","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=209550"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/209550\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=209550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=209550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=209550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}