{"id":541,"date":"2017-02-26T15:10:47","date_gmt":"2017-02-26T14:10:47","guid":{"rendered":"http:\/\/feuilletages-algebriques.math.cnrs.fr\/?page_id=541"},"modified":"2017-02-26T15:10:47","modified_gmt":"2017-02-26T14:10:47","slug":"programmes-images","status":"publish","type":"page","link":"https:\/\/feuilletages-algebriques.math.cnrs.fr\/index.php\/programmes-images\/","title":{"rendered":"Programmes, images"},"content":{"rendered":"<pre># -*- coding: utf-8 -*-\r\n\r\n# Intersection de la feuille (du feuilletage lin\u00e9aire dX\/dt=X, dY\/dt=mu.Y (Im(mu)&gt;0))\r\n# passant par un point donn\u00e9 \u00e0 distance rayonSphere de l'origine avec la sph\u00e8re S^3(rayonSphere)\r\n\r\n# Entr\u00e9es :\r\n# - (u,v) \\in S^3(rayonSphere)\r\n# - nombre de points sur la bi-orbite\r\n# Sortie : projection st\u00e9r\u00e9ographique dans R^3 de la bi-orbite de (u,v)\r\n\r\n\r\n########################\r\n\r\nimport numpy as np\r\nimport subprocess\r\nfrom povwriter import *\r\nfrom multiprocessing import Manager, Process, current_process\r\nimport time\r\n#import sys\r\n\r\nI = complex(0,1)\r\nJ = -1.\/2+I*np.sqrt(3)\/2\r\npi = np.pi\r\ndebut = time.time()\r\n\r\n########################\r\n########################\r\n\r\n## Norme d'un vecteur\r\ndef normeVecteur(Z):\r\n return np.sqrt(abs(Z[0])**2+abs(Z[1])**2)\r\n\r\n\r\n## Projection st\u00e9r\u00e9ographique de S^3(rayonSphere) dans C^2 sur R^3 comme plan \u00e9quatorial\r\ndef projectionStereo(Z,rayonSphere):\r\n return [rayonSphere*Z[0].real\/(rayonSphere-Z[1].imag),\r\n rayonSphere*Z[0].imag\/(rayonSphere-Z[1].imag),\r\n rayonSphere*Z[1].real\/(rayonSphere-Z[1].imag)]\r\n\r\n\r\n## Rotation dans C^2\r\ndef rotationC2(Z):\r\n alpha = 1\/np.sqrt(2)\r\n beta = 1\/np.sqrt(2)\r\n R = np.array([[alpha,-beta.conjugate()],[beta,alpha.conjugate()]])\r\n return np.dot(R,Z)\r\n\r\n\r\n## Sym\u00e9trie d'ordre 3\r\ndef symetrie(Z):\r\n return np.array([J.conjugate()*Z[0],J*Z[1]])\r\n\r\n\r\n########################\r\n########################\r\n\r\n## Calcul et dessin des deux orbites p\u00e9riodiques\r\ndef orbitesPeriodiques(rayonSphere) :\r\n discretisation = 10**3\r\n cercle1 = [] ; cercle2 = []\r\n for i in range(discretisation+1):\r\n cercle1.append(projectionStereo(rotationC2(np.array([rayonSphere*np.exp(2*I*pi*i\/discretisation),0])),rayonSphere))\r\n cercle2.append(projectionStereo(rotationC2(np.array([0,rayonSphere*np.exp(2*I*pi*i\/discretisation)])),rayonSphere))\r\n for i in range(discretisation):\r\n Cylinder(cercle1[i],cercle1[i+1],\r\n 0.005,\r\n Texture(\r\n #Finish(\r\n # ambient = 0.0,\r\n # diffuse = 0.0,\r\n # reflection = 1,\r\n # specular = 1\r\n #),\r\n Pigment(color = (0,1,0)))\r\n ).write(image)\r\n Cylinder(cercle2[i],cercle2[i+1],\r\n 0.005,\r\n Texture(\r\n #Finish(\r\n # ambient = 0.0,\r\n # diffuse = 0.0,\r\n # reflection = 1,\r\n # specular = 1\r\n #),\r\n Pigment(color = (0,0,1)))\r\n ).write(image)\r\n\r\n########################\r\n########################\r\n\r\n\r\ndef ecrirePOV(image,orbitePartielle,rayonSphere):\r\n for i in range(len(orbitePartielle)-1):\r\n Cylinder(projectionStereo(rotationC2(orbitePartielle[i]),rayonSphere),\r\n projectionStereo(rotationC2(orbitePartielle[i+1]),rayonSphere),\r\n 0.005,\r\n Texture(\r\n #Finish(\r\n # ambient = 0.0,\r\n # diffuse = 0.0,\r\n # reflection = 0.85,\r\n # specular = 1\r\n #),\r\n Pigment(color = (1,1,1)))\r\n ).write(image)\r\n if (symCondInit == 1):\r\n Cylinder(projectionStereo(rotationC2(symetrie(orbitePartielle[i])),rayonSphere),\r\n projectionStereo(rotationC2(symetrie(orbitePartielle[i+1])),rayonSphere),\r\n 0.005,\r\n Texture(\r\n #Finish(\r\n # ambient = 0.0,\r\n # diffuse = 0.0,\r\n # reflection = 0.85,\r\n # specular = 1\r\n #),\r\n Pigment(color = (0.8,0.8,0.8)))\r\n ).write(image)\r\n Cylinder(projectionStereo(rotationC2(symetrie(symetrie(orbitePartielle[i]))),rayonSphere),\r\n projectionStereo(rotationC2(symetrie(symetrie(orbitePartielle[i+1]))),rayonSphere),\r\n 0.005,\r\n Texture(\r\n #Finish(\r\n # ambient = 0.0,\r\n # diffuse = 0.0,\r\n # reflection = 0.85,\r\n # specular = 1\r\n #),\r\n Pigment(color = (0.6,0.6,0.6)))\r\n ).write(image)\r\n\r\n\r\n########################\r\n########################\r\n\r\n\r\n## Intersection du champ de vecteurs avec S^3(rayonSphere)\r\ndef champS3(X,sens):\r\n mu = (4*J+5)\/(4*J-1)\r\n gamma = (abs(X[0])**2+mu.conjugate()*abs(X[1])**2)*I\r\n return(sens*gamma*np.array([X[0],mu*X[1]]))\r\n\r\n\r\n## Sch\u00e9ma de Runge-Kutta\r\ndef rungeKutta(X,sens):\r\n dt = 2**(-10)\r\n k1 = champS3(X,sens)\r\n k2 = champS3(X+k1*dt\/2,sens)\r\n k3 = champS3(X+k2*dt\/2,sens)\r\n k4 = champS3(X+k3*dt,sens)\r\n return X+(k1+2*k2+2*k3+k4)*dt\/6\r\n\r\n\r\n## Calcul de la bi-orbite d'un point dans C^2 (en fait sur S^3(rayonSphere), cf. d\u00e9finition champS3)\r\ndef orbiteIntersectionSphere(_,nbPointsOrbite,condInit,sens):\r\n trajectoire = [condInit]\r\n for point in range(nbPointsOrbite):\r\n trajectoire.append(rungeKutta(trajectoire[-1],sens))\r\n processusCalcul[int(current_process().name.split(\"-\")[1])-2] = trajectoire\r\n\r\n\r\n\r\n########################\r\n########################\r\n########################\r\n\r\n\r\n#symCondInit = input(\"Conditions initiales sym\u00e9triques ? \")\r\n#nbPointsOrbite = input(\"Nombre de points calcul\u00e9s : \")\r\n#nbPointsOrbite = int(sys.argv[1])\r\nsymCondInit = 1\r\nnbPointsOrbite = 6*10**3\r\nC1 = np.array([(np.sqrt(3)+I)\/(2*np.sqrt(2)),np.exp(I*pi\/4)\/np.sqrt(2)])\r\nrayonSphere = normeVecteur(C1)\r\n\r\n\r\nif __name__ == '__main__':\r\n image = POVFile(\"singularite-lineaire.pov\")\r\n Camera(location = (0, 1, -5.5), look_at = (0, 0, 0)).write(image)\r\n LightSource<sup id=\"footnote_plugin_tooltip_1\" class=\"footnote_plugin_tooltip_text\" onclick=\"footnote_moveToAnchor('footnote_plugin_reference_1');\">1)<\/sup><span class=\"footnote_tooltip\" id=\"footnote_plugin_tooltip_text_1\">10, 10, -10), color = (1, 1, 1<\/span><script type=\"text\/javascript\">\tjQuery(\"#footnote_plugin_tooltip_1\").tooltip({\t\ttip: \"#footnote_plugin_tooltip_text_1\",\t\ttipClass: \"footnote_tooltip\",\t\teffect: \"fade\",\t\tfadeOutSpeed: 100,\t\tpredelay: 400,\t\tposition: \"top right\",\t\trelative: true,\t\toffset: [10, 10]\t});<\/script>.write(image)\r\n LightSource<sup id=\"footnote_plugin_tooltip_2\" class=\"footnote_plugin_tooltip_text\" onclick=\"footnote_moveToAnchor('footnote_plugin_reference_2');\">2)<\/sup><span class=\"footnote_tooltip\" id=\"footnote_plugin_tooltip_text_2\">15, 15, -10), color = (1, 1, 1 <\/span><script type=\"text\/javascript\">\tjQuery(\"#footnote_plugin_tooltip_2\").tooltip({\t\ttip: \"#footnote_plugin_tooltip_text_2\",\t\ttipClass: \"footnote_tooltip\",\t\teffect: \"fade\",\t\tfadeOutSpeed: 100,\t\tpredelay: 400,\t\tposition: \"top right\",\t\trelative: true,\t\toffset: [10, 10]\t});<\/script>.write(image)\r\n LightSource<sup id=\"footnote_plugin_tooltip_3\" class=\"footnote_plugin_tooltip_text\" onclick=\"footnote_moveToAnchor('footnote_plugin_reference_3');\">3)<\/sup><span class=\"footnote_tooltip\" id=\"footnote_plugin_tooltip_text_3\">-15, 15, -10), color = (1, 1, 1<\/span><script type=\"text\/javascript\">\tjQuery(\"#footnote_plugin_tooltip_3\").tooltip({\t\ttip: \"#footnote_plugin_tooltip_text_3\",\t\ttipClass: \"footnote_tooltip\",\t\teffect: \"fade\",\t\tfadeOutSpeed: 100,\t\tpredelay: 400,\t\tposition: \"top right\",\t\trelative: true,\t\toffset: [10, 10]\t});<\/script>.write(image)\r\n LightSource<sup id=\"footnote_plugin_tooltip_4\" class=\"footnote_plugin_tooltip_text\" onclick=\"footnote_moveToAnchor('footnote_plugin_reference_4');\">4)<\/sup><span class=\"footnote_tooltip\" id=\"footnote_plugin_tooltip_text_4\">15, -15, -10), color = (1, 1, 1<\/span><script type=\"text\/javascript\">\tjQuery(\"#footnote_plugin_tooltip_4\").tooltip({\t\ttip: \"#footnote_plugin_tooltip_text_4\",\t\ttipClass: \"footnote_tooltip\",\t\teffect: \"fade\",\t\tfadeOutSpeed: 100,\t\tpredelay: 400,\t\tposition: \"top right\",\t\trelative: true,\t\toffset: [10, 10]\t});<\/script>.write(image)\r\n LightSource<sup id=\"footnote_plugin_tooltip_5\" class=\"footnote_plugin_tooltip_text\" onclick=\"footnote_moveToAnchor('footnote_plugin_reference_5');\">5)<\/sup><span class=\"footnote_tooltip\" id=\"footnote_plugin_tooltip_text_5\">10, 10, -10), color = (0, 0, 0.3<\/span><script type=\"text\/javascript\">\tjQuery(\"#footnote_plugin_tooltip_5\").tooltip({\t\ttip: \"#footnote_plugin_tooltip_text_5\",\t\ttipClass: \"footnote_tooltip\",\t\teffect: \"fade\",\t\tfadeOutSpeed: 100,\t\tpredelay: 400,\t\tposition: \"top right\",\t\trelative: true,\t\toffset: [10, 10]\t});<\/script>.write(image)\r\n LightSource<sup id=\"footnote_plugin_tooltip_6\" class=\"footnote_plugin_tooltip_text\" onclick=\"footnote_moveToAnchor('footnote_plugin_reference_6');\">6)<\/sup><span class=\"footnote_tooltip\" id=\"footnote_plugin_tooltip_text_6\">-10, 10, -10), color = (0, 0.3, 0<\/span><script type=\"text\/javascript\">\tjQuery(\"#footnote_plugin_tooltip_6\").tooltip({\t\ttip: \"#footnote_plugin_tooltip_text_6\",\t\ttipClass: \"footnote_tooltip\",\t\teffect: \"fade\",\t\tfadeOutSpeed: 100,\t\tpredelay: 400,\t\tposition: \"top right\",\t\trelative: true,\t\toffset: [10, 10]\t});<\/script>.write(image)\r\n LightSource<sup id=\"footnote_plugin_tooltip_7\" class=\"footnote_plugin_tooltip_text\" onclick=\"footnote_moveToAnchor('footnote_plugin_reference_7');\">7)<\/sup><span class=\"footnote_tooltip\" id=\"footnote_plugin_tooltip_text_7\">10, -10, -10), color = (0.3, 0, 0<\/span><script type=\"text\/javascript\">\tjQuery(\"#footnote_plugin_tooltip_7\").tooltip({\t\ttip: \"#footnote_plugin_tooltip_text_7\",\t\ttipClass: \"footnote_tooltip\",\t\teffect: \"fade\",\t\tfadeOutSpeed: 100,\t\tpredelay: 400,\t\tposition: \"top right\",\t\trelative: true,\t\toffset: [10, 10]\t});<\/script>.write(image)\r\n \r\n manager = Manager()\r\n processusCalcul = manager.list(range(2))\r\n p = [Process(target=orbiteIntersectionSphere,args=(processusCalcul,nbPointsOrbite,C1,-1)),\r\n Process(target=orbiteIntersectionSphere,args=(processusCalcul,nbPointsOrbite,C1,1))]\r\n for each in p: each.start()\r\n for each in p: each.join()\r\n \r\n orbitesPeriodiques(rayonSphere)\r\n #il est bon de faire une petite rotation pour \u00e9viter qu'une des deux orbites p\u00e9riodiques ne rencontre le p\u00f4le de projection\r\n ecrirePOV(image,processusCalcul[0],rayonSphere)\r\n ecrirePOV(image,processusCalcul[1],rayonSphere)\r\n \r\n fin = time.time()\r\n print(fin-debut)\r\n\r\nsubprocess.Popen([\"povray\", \"+A +FN +P +w1920 +h1080 \/Users\/Emilie\/Seafile\/Mathrice-Travail\/Feuilletages-holomorphes-Jouanolou\/Calculs-numeriques\/singularite-lineaire\/python-pov\/singularite-lineaire.pov\"])<\/pre>\n<div class=\"footnote_container_prepare\">\t<p><span onclick=\"footnote_expand_reference_container();\">References<\/span><span style=\"display: none;\">&nbsp;&nbsp;&nbsp;[ <a id=\"footnote_reference_container_collapse_button\" style=\"cursor:pointer;\" onclick=\"footnote_expand_collapse_reference_container();\">+<\/a> ]<\/span><\/p><\/div><div id=\"footnote_references_container\" style=\"\">\t<table class=\"footnote-reference-container\">\t\t<tbody>\t\t<tr>\t<td class=\"footnote_plugin_index\"><span id=\"footnote_plugin_reference_1\">1.<\/span><\/td>\t<td class=\"footnote_plugin_link\"><span onclick=\"footnote_moveToAnchor('footnote_plugin_tooltip_1');\">&#8593;<\/span><\/td>\t<td class=\"footnote_plugin_text\">10, 10, -10), color = (1, 1, 1<\/td><\/tr><tr>\t<td class=\"footnote_plugin_index\"><span id=\"footnote_plugin_reference_2\">2.<\/span><\/td>\t<td class=\"footnote_plugin_link\"><span onclick=\"footnote_moveToAnchor('footnote_plugin_tooltip_2');\">&#8593;<\/span><\/td>\t<td class=\"footnote_plugin_text\">15, 15, -10), color = (1, 1, 1 <\/td><\/tr><tr>\t<td class=\"footnote_plugin_index\"><span id=\"footnote_plugin_reference_3\">3.<\/span><\/td>\t<td class=\"footnote_plugin_link\"><span onclick=\"footnote_moveToAnchor('footnote_plugin_tooltip_3');\">&#8593;<\/span><\/td>\t<td class=\"footnote_plugin_text\">-15, 15, -10), color = (1, 1, 1<\/td><\/tr><tr>\t<td class=\"footnote_plugin_index\"><span id=\"footnote_plugin_reference_4\">4.<\/span><\/td>\t<td class=\"footnote_plugin_link\"><span onclick=\"footnote_moveToAnchor('footnote_plugin_tooltip_4');\">&#8593;<\/span><\/td>\t<td class=\"footnote_plugin_text\">15, -15, -10), color = (1, 1, 1<\/td><\/tr><tr>\t<td class=\"footnote_plugin_index\"><span id=\"footnote_plugin_reference_5\">5.<\/span><\/td>\t<td class=\"footnote_plugin_link\"><span onclick=\"footnote_moveToAnchor('footnote_plugin_tooltip_5');\">&#8593;<\/span><\/td>\t<td class=\"footnote_plugin_text\">10, 10, -10), color = (0, 0, 0.3<\/td><\/tr><tr>\t<td class=\"footnote_plugin_index\"><span id=\"footnote_plugin_reference_6\">6.<\/span><\/td>\t<td class=\"footnote_plugin_link\"><span onclick=\"footnote_moveToAnchor('footnote_plugin_tooltip_6');\">&#8593;<\/span><\/td>\t<td class=\"footnote_plugin_text\">-10, 10, -10), color = (0, 0.3, 0<\/td><\/tr><tr>\t<td class=\"footnote_plugin_index\"><span id=\"footnote_plugin_reference_7\">7.<\/span><\/td>\t<td class=\"footnote_plugin_link\"><span onclick=\"footnote_moveToAnchor('footnote_plugin_tooltip_7');\">&#8593;<\/span><\/td>\t<td class=\"footnote_plugin_text\">10, -10, -10), color = (0.3, 0, 0<\/td><\/tr>\t\t<\/tbody>\t<\/table><\/div><script type=\"text\/javascript\">\tfunction footnote_expand_reference_container() {\t\tjQuery(\"#footnote_references_container\").show();        jQuery(\"#footnote_reference_container_collapse_button\").text(\"-\");\t}    function footnote_collapse_reference_container() {        jQuery(\"#footnote_references_container\").hide();        jQuery(\"#footnote_reference_container_collapse_button\").text(\"+\");    }\tfunction footnote_expand_collapse_reference_container() {\t\tif (jQuery(\"#footnote_references_container\").is(\":hidden\")) {            footnote_expand_reference_container();\t\t} else {            footnote_collapse_reference_container();\t\t}\t}    function footnote_moveToAnchor(p_str_TargetID) {        footnote_expand_reference_container();        var l_obj_Target = jQuery(\"#\" + p_str_TargetID);        if(l_obj_Target.length) {            jQuery('html, body').animate({                scrollTop: l_obj_Target.offset().top - window.innerHeight\/2            }, 1000);        }    }<\/script>","protected":false},"excerpt":{"rendered":"<p># -*- coding: utf-8 -*- # Intersection de la feuille (du feuilletage lin\u00e9aire dX\/dt=X, dY\/dt=mu.Y (Im(mu)&gt;0)) # passant par un point donn\u00e9 \u00e0 distance rayonSphere de l&rsquo;origine avec la sph\u00e8re S^3(rayonSphere) # Entr\u00e9es : # &#8211; (u,v) \\in S^3(rayonSphere) # &#8211; nombre de points sur la bi-orbite # Sortie : projection st\u00e9r\u00e9ographique dans R^3 de &hellip; <a href=\"https:\/\/feuilletages-algebriques.math.cnrs.fr\/index.php\/programmes-images\/\" class=\"more-link\">Continuer la lecture<span class=\"screen-reader-text\"> de &laquo;&nbsp;Programmes, images&nbsp;&raquo;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-541","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/feuilletages-algebriques.math.cnrs.fr\/index.php\/wp-json\/wp\/v2\/pages\/541","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/feuilletages-algebriques.math.cnrs.fr\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/feuilletages-algebriques.math.cnrs.fr\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/feuilletages-algebriques.math.cnrs.fr\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/feuilletages-algebriques.math.cnrs.fr\/index.php\/wp-json\/wp\/v2\/comments?post=541"}],"version-history":[{"count":1,"href":"https:\/\/feuilletages-algebriques.math.cnrs.fr\/index.php\/wp-json\/wp\/v2\/pages\/541\/revisions"}],"predecessor-version":[{"id":542,"href":"https:\/\/feuilletages-algebriques.math.cnrs.fr\/index.php\/wp-json\/wp\/v2\/pages\/541\/revisions\/542"}],"wp:attachment":[{"href":"https:\/\/feuilletages-algebriques.math.cnrs.fr\/index.php\/wp-json\/wp\/v2\/media?parent=541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}