{"id":1977,"date":"2024-12-08T15:57:26","date_gmt":"2024-12-08T14:57:26","guid":{"rendered":"https:\/\/blog.univ-angers.fr\/mathsinfo\/?p=1977"},"modified":"2024-12-08T17:19:08","modified_gmt":"2024-12-08T16:19:08","slug":"enveloppe-dune-famille-de-droites","status":"publish","type":"post","link":"https:\/\/blog.univ-angers.fr\/mathsinfo\/2024\/12\/08\/enveloppe-dune-famille-de-droites\/","title":{"rendered":"Enveloppe d&rsquo;une famille de droites"},"content":{"rendered":"\n<p>En parcourant <a href=\"https:\/\/acpc.me\/ACME\/?LITTERATURE_LIVRES\/%5BFRA%5DFRENCH\/PSI_BCM\" target=\"_blank\" rel=\"noreferrer noopener\">le livre \u00ab\u00a0Mathematiques et graphismes\u00a0\u00bb<\/a> de 1985, j&rsquo;ai trouv\u00e9 page 41 un programme int\u00e9ressant en <strong>BASIC<\/strong> (pour TO7\/Apple\/Commodore 64\/Oric etc)  permettant de tracer une enveloppe de droites (de la forme <strong>ax+by+c = 0<\/strong>). En faisant varier <strong>a,b<\/strong> et <strong>c<\/strong> en fonction d&rsquo;un param\u00e8tre (not\u00e9 <strong>t<\/strong> dans le programme), on obtient des visuels sympathiques :<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/12\/image.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/12\/image-1024x768.png\" alt=\"\" class=\"wp-image-1978\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/12\/image-1024x768.png 1024w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/12\/image-300x225.png 300w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/12\/image-768x576.png 768w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/12\/image-400x300.png 400w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/12\/image.png 1110w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/12\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/12\/image-1-1024x768.png\" alt=\"\" class=\"wp-image-1979\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/12\/image-1-1024x768.png 1024w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/12\/image-1-300x225.png 300w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/12\/image-1-768x576.png 768w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/12\/image-1-400x300.png 400w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/12\/image-1.png 1110w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/12\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/12\/image-2-1024x768.png\" alt=\"\" class=\"wp-image-1980\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/12\/image-2-1024x768.png 1024w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/12\/image-2-300x225.png 300w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/12\/image-2-768x576.png 768w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/12\/image-2-400x300.png 400w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/12\/image-2.png 1110w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">Traduction en Python (avec 18 exemples)<\/h2>\n\n\n\n<p><a href=\"https:\/\/my.numworks.com\/python\/schraf\/enveloppes\" target=\"_blank\" rel=\"noreferrer noopener\">Version pour la NUMWORKS ici<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import turtle\nfrom math import *\nfrom time import sleep\n\nt = turtle.Turtle()\nt.hideturtle()\nt.pensize(2)\n\nw, h = 800, 600\n\nwn = turtle.Screen()\n\nwn.colormode(255)\nt.pencolor(255, 255, 0)\n\n\ndef ex0():\n    def g(t):\n        return 2 - t * t, -2 * t, t**3\n\n    return g, -5, 5, -2, 1.5, -3, 3\n\n\ndef ex1():\n    def g(t):\n        return cos(3 * t), sin(3 * t), sin(t) ** 2\n\n    return g, -1, 1, -1.1, 1.1, 0, 2 * pi\n\n\ndef ex2():\n    def g(t):\n        return cos(3 * t), sin(3 * t), cos(t)\n\n    return g, -1.2, 0.8, -1.2, 1.2, -pi \/ 2, pi \/ 2\n\n\ndef ex3():\n    def g(t):\n        return cos(t), sin(t), exp(-exp(-t \/ 5))\n\n    return g, -2, 2, -2, 3, -5, 10\n\n\ndef ex4():\n    def g(t):\n        return cos(t), sin(t), -sin(t) \/ t\n\n    return g, -0.3, 1.2, -0.9, 0.9, -5, 5\n\n\ndef ex5():\n    def g(t):\n        return cos(t), sin(t), -1 - int(t \/ 2 \/ pi)\n\n    return g, -6, 6, -6, 6, 0, 10 * pi\n\n\ndef ex6():\n    def g(t):\n        return cos(t), sin(t), 1 \/ t\n\n    return g, -2, 2, -1, 0.5, -10, 10\n\n\ndef ex7():\n    def g(t):\n        return cos(t), sin(t), log10(t)\n\n    return g, -4, 4, -4, 4, 0.2, 20\n\n\ndef ex8():\n    def g(t):\n        return cos(t), sin(t), t * t * sin(t)\n\n    return g, -4, 4, -10, 3, -pi, pi\n\n\ndef ex9():\n    def g(t):\n        return cos(t), sin(t), t * t \/ (1 + t * t)\n\n    return g, -1, 1, -1, 1, -2 * pi, 2 * pi\n\n\ndef ex10():\n    def g(t):\n        return cos(t), sin(t), (1 - t * t) \/ (1 + t * t)\n\n    return g, -1.5, 1.5, -1.5, 1.5, -2 * pi, 2 * pi\n\n\ndef ex11():\n    def g(t):\n        return cos(t), sin(t), sqrt(abs(t))\n\n    return g, -4, 4, -4, 4, -10, 10\n\n\ndef ex12():\n    def g(t):\n        return cos(t), sin(t), t \/ (1 + t)\n\n    return g, -3, 3, -3, 3, -10, 10\n\n\ndef ex13():\n    def g(t):\n        return cos(t), sin(t), 2 + cos(t \/ 2)\n\n    return g, -4, 4, -4, 4, -2 * pi, 2 * pi\n\n\ndef ex14():\n    def g(t):\n        return cos(t), sin(t), -0.5 + cos(t \/ 2)\n\n    return g, -2, 2, -2, 2, -2 * pi, 2 * pi\n\n\ndef ex15():\n    def g(t):\n        return cos(t), sin(t), t * t * sin(t)\n\n    return g, -4, 4, -10, 3, -pi, pi\n\n\ndef ex16():\n    def g(t):\n        return cos(t), sin(t), t * t \/ (1 - t * t)\n\n    return g, -1.5, 2, -2, 2, -2 * pi, 2 * pi\n\n\ndef ex17():\n    def g(t):\n        return cos(t), sin(t), sin(t) + sin(t) ** 2 \/ 2 + sin(t) ** 3 \/ 3\n\n    return g, -2, 2, -3, 0, -pi, pi\n\n\ndef tracer(x, y):\n    global f, pts\n    if x &lt; xi or x &gt; xs or y &lt; yi or y &gt; ys:\n        return\n    f += 1\n    pts&#091;f] = &#091;\n        -w \/ 2 + ceil(w * (x - xi) \/ (xs - xi)),\n        -h \/ 2 + ceil(h * (y - yi) \/ (ys - yi)),\n    ]\n    if f == 1 and pts&#091;0] == pts&#091;1]:\n        f = -1\n    elif f == 1:\n        t.penup()\n        t.goto(pts&#091;0])\n        t.pendown()\n        t.goto(pts&#091;1])\n\n\nt.hideturtle()\nfor k in range(18):\n    turtle.Screen().bgcolor(0, 0, 0)\n    t.clear()\n    wn.tracer(0)\n    g, xi, xs, yi, ys, ti, ts = eval(\"ex\" + str(k) + \"()\")\n    pts = &#091;&#091;0, 0], &#091;0, 0]]\n    n = 200\n    th = (ts - ti) \/ (n - 1)\n    for i in range(n):\n        try: a, b, c = g(ti + i * th)\n        except: continue\n        f = -1\n        if b != 0:\n            tracer(xi, -(c + a * xi) \/ b)\n            tracer(xs, -(c + a * xs) \/ b)\n        if a != 0:\n            tracer(-(c + b * yi) \/ a, yi)\n            tracer(-(c + b * ys) \/ a, ys)\n    wn.update()\n    sleep(2)\n<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>En parcourant le livre \u00ab\u00a0Mathematiques et graphismes\u00a0\u00bb de 1985, j&rsquo;ai trouv\u00e9 page 41 un programme int\u00e9ressant en BASIC (pour TO7\/Apple\/Commodore 64\/Oric etc) permettant de tracer une enveloppe de droites (de la forme ax+by+c = 0). En faisant varier a,b et &hellip; <a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/2024\/12\/08\/enveloppe-dune-famille-de-droites\/\">Continuer la lecture <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":4913,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1977","post","type-post","status-publish","format-standard","hentry","category-non-classe"],"_links":{"self":[{"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/posts\/1977","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/users\/4913"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/comments?post=1977"}],"version-history":[{"count":2,"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/posts\/1977\/revisions"}],"predecessor-version":[{"id":1982,"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/posts\/1977\/revisions\/1982"}],"wp:attachment":[{"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/media?parent=1977"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/categories?post=1977"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/tags?post=1977"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}