{"id":10427,"date":"2025-09-29T13:20:30","date_gmt":"2025-09-29T11:20:30","guid":{"rendered":"https:\/\/spgoo.org\/?page_id=10427"},"modified":"2025-09-29T13:20:30","modified_gmt":"2025-09-29T11:20:30","slug":"fonction-de-leontieff","status":"publish","type":"page","link":"https:\/\/spgoo.org\/?page_id=10427","title":{"rendered":"Fonction de Leontieff"},"content":{"rendered":"<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/katex\/dist\/katex.min.js\"><\/script>\r\n<link href=\"https:\/\/cdn.jsdelivr.net\/npm\/katex\/dist\/katex.min.css\" rel=\"stylesheet\">\r\n<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/jsxgraph\/distrib\/jsxgraphcore.min.js\"><\/script>   \r\n      \r\n\r\n<script>\r\nwindow.MathJax = {\r\n  tex: {\r\n    inlineMath: [ ['$','$'], [\"\\\\(\",\"\\\\)\"] ],\r\n    displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"] ],\r\n    packages: ['base', 'ams']\r\n  },\r\n  options: {\r\n    ignoreHtmlClass: 'tex2jax_ignore',\r\n    processHtmlClass: 'tex2jax_process'\r\n  }\r\n};\r\n<\/script>  \r\n<script type=\"text\/javascript\" id=\"MathJax-script\"   src=\"https:\/\/cdn.jsdelivr.net\/npm\/mathjax@3\/es5\/tex-mml-chtml.js\"> <\/script>\r\n<div style=\"margin:0px 0px 0px 150px;\">\r\n  \t<h4>\r\n    Fonction de Leontief $U(x,y) = \\\\min(x, 2 y)$ \r\n  <\/h4>\r\n  <div style=\"width:900px;height:800px;text-align:center;\" >\r\n    <div id=\"box1\" class=\"jxgbox\" style=\"width:700px; height:600px;\"><\/div>\r\n    <div id=\"box2\" class=\"jxgbox\" style=\"width:700px; height:100px;\"><\/div>\r\n  <\/div>\r\n<\/div>\t\t\r\n<script type=\"text\/javascript\">\r\nJXG.Options.text.useKatex = true; \/\/ going to use Katex for all labels\r\nJXG.Options.text.cssDefaultStyle = 'font-family:KaTeX_Main, serif;font-size:4 vmin';\r\nJXG.Options.text.highlightCssDefaultStyle = 'font-family:KaTeX_Main, serif;font-size:4 vmin';\r\n\r\n\/* \r\nCr\u00e9ation d'un board 500 par 500 pixels utilisant MathJax\r\nA l'int\u00e9rieur de ce board (tableau) on d\u00e9finit une bo\u00eete (a,b,c,d) de la forme (a,c)(a,b)(c,b)(c,d)=(-10,-20)(-10,450)(100,450)(100,-20)\r\navec axes mais pas de lignes (donc pas de quadrillage) et pas de tics sur les axes\r\n*\/\r\nvar board = JXG.JSXGraph.initBoard(\"box1\", {pan: {enabled:false},boundingbox: [-2.5,6, 10,-1],\r\nwithLines:true,keepaspectratio: true, axis:true, showNavigation:false,showInfobox: false,showCopyright:false});\r\nboard.renderer.container.style.backgroundColor='#C5ADC5';\r\n\r\nvar boardCommandes = JXG.JSXGraph.initBoard(\"box2\", {pan: {enabled:false},boundingbox: [-1,4, 15,-1],\r\nwithLines:true,keepaspectratio: false, axis:false, showNavigation:false,showInfobox: false,showCopyright:false});\r\nboardCommandes.renderer.container.style.backgroundColor='#C5ADC5';\r\n\r\n\r\n\/\/ projection des lignes de niveau\r\n\/\/ lignes de niveau sur la courbe\r\nfunction drawLeontiefLevel(view,pente,  c, horizontalLength, verticalLength) {\r\n  const yLevel = c \/ pente;\r\n  \/\/ Segment horizontal : y = c\/2, x \u2208 [c, c + horizontalLength]\r\n  view.create('curve3d',[(t) => t,(t) => yLevel,(t) => c,[c, horizontalLength]], {strokeWidth: 2,strokeColor: '#C80815',dash: 2});\r\n  \/\/ Segment vertical : x = c, y \u2208 [c\/2, c\/2 + verticalLength]\r\n  view.create('curve3d', [(t) => c,(t) => t,(t) => c,[yLevel, verticalLength]], {strokeWidth: 2,strokeColor: '#C80815',dash: 2 });\r\n  \/\/ \u00c9tiquette au coin du L\r\n  view.create('text3d', [c + 0.1, yLevel + 0.1, c, `${c.toFixed(1)}`], {fixed:true, fontSize: 12,strokeColor: '#C80815'}); \r\n}\r\n\/\/ courbes de niveau sur le plan bas \r\nfunction drawLeontiefLevelProjected(view,pente, c, horizontalLength, verticalLength) {\r\n  const yLevel = c \/ pente;\r\n  const zProjection = 0;\r\n  \/\/ Segment horizontal projet\u00e9 : y = c\/2, x \u2208 [c, c + horizontalLength]\r\n  view.create('curve3d', [(t) => t,(t) => yLevel,(t) => zProjection,[c,  horizontalLength]], {strokeWidth: 2,strokeColor: '#AE181E',dash: 0});\r\n  \/\/ Segment vertical projet\u00e9 : x = c, y \u2208 [c\/2, c\/2 + verticalLength]\r\n  view.create('curve3d', [(t) => c,(t) => t,(t) => zProjection,[yLevel,  verticalLength]], {strokeWidth: 2,strokeColor: '#AE181E',dash: 0  });\r\n  \/\/ \u00c9tiquette au coin du L projet\u00e9\r\n  view.create('text3d', [c + 0.1, yLevel + 0.1, zProjection, `${c.toFixed(1)}`], {fixed:true, fontSize: 12,strokeColor: '#C80815'});\r\n}\r\n\r\n\/\/ courbes de niveau sur le plan x, z \r\nfunction drawLeontiefLevelProjectedXZ(view,pente, c, horizontalLength, verticalLength) {\r\n  const yLevel = c;\r\n  const zProjection = 0;\r\n  const posit=c\/pente;\r\n  view.create('curve3d', [(t) => zProjection,(t) => t,(t) => c,[posit,  horizontalLength]], {strokeWidth: 2,strokeColor: 'lightblue',dash: 0});\r\n  \/\/ Segment vertical projet\u00e9 : x = c, y \u2208 [c\/2, c\/2 + verticalLength]\r\n  view.create('curve3d', [ (t) => t, (t) => zProjection , (t) => c,[yLevel,  verticalLength]], {strokeWidth: 2,strokeColor: 'lightblue',dash: 0  });\r\n  \/\/ \u00c9tiquette au coin du L projet\u00e9\r\n  \/\/ view.create('text3d', [c + 0.1, yLevel + 0.1, zProjection, `${c.toFixed(1)}`], {fontSize: 12,strokeColor: '#C80815'});\r\n}\r\n\r\n\r\nconst creation_environnement=function(pente, nb) {\r\n\/\/ creation du board  ; \r\n  if (board!=null) {\r\n\t\t\/\/ nettoie le board complet \r\n\t\tJXG.JSXGraph.freeBoard(board);\r\n\t}\r\n  board = JXG.JSXGraph.initBoard(\"box1\", {pan: {enabled:false},boundingbox: [-2.5,6, 10,-1],\r\n          withLines:false,keepaspectratio: true, axis:false, showNavigation:false,showInfobox: false,showCopyright:false});\r\n  board.renderer.container.style.backgroundColor='#C5ADC5';\r\n  var box = [0, 4];\r\n  var view = board.create('view3d',\r\n    [[-1, -1], [8, 8], [box, box, box] ],\r\n    {\r\n        xPlaneRear: {visible: false},\r\n        yPlaneRear: {visible: false},\r\n        slider:{visible:true}\r\n    });\r\n  \/\/ Positionnement des labels    \r\n  var xlabel = view.create(\"point3d\",[1.2 * box[1], 0, 1.4 * box[0] + 0.35 * box[1]], {fixed:true, size: 0,name: \"x\"}); \r\n  var Ylabel = view.create(\"point3d\",[0, 1.025 * box[1], 0.6 * box[0] + 0.15 * box[1]], {fixed:true, size: 0, name: \"y\" });\r\n  var Zlabel = view.create(\"point3d\",[0.7 * (0.6 * box[0] + .4 * box[1]),0.7 * (0.6 * box[0] + 0.3 * box[1]),1.05 * box[1],], {fixed:true, size: 0,name: \"z\"});  \r\n\r\n  \/\/ Function F to be plotted\r\n  var F = (x, y) => Math.min(x, pente*y)\r\n\r\n  \/\/ 3D surface\r\n  var c = view.create('functiongraph3d', [F,box,box], {strokeColor:\"#5F9EA0\", strokeWidth: 1,stepsU: 100,stepsV: 100});\r\n  const pas=4.0\/nb;\r\n  let i=0;\r\n  while(i<4) {\r\n  \/\/for (let i=0; i<nb-1;i+=pas) {\r\n    drawLeontiefLevel(view,pente,i, 3.9, 3.9); \/\/ niveau 1, bras horizontal plus long\r\n    drawLeontiefLevelProjected(view,pente,i, 3.9, 3.9);\r\n    drawLeontiefLevelProjectedXZ(view,pente,i, 4, 4);\r\n    i+=pas;\r\n  }\r\n\r\n  \/\/\/arr\u00eate\r\n  \/\/ Droite dans l'espace : x = 2y, libre en z\r\n  var line3D = view.create('curve3d', [(t) => t,(t) => 1\/pente*t,(t) => t,[0, 4]], {strokeWidth: 3,strokeColor: 'goldenrod', name: 'x=2y'});\r\n  \/\/ Projection dans le plan z = -1 : droite y = 1\/2 x\r\n  var lineProj = view.create('curve3d', [(t) => t,(t) => 1\/pente*t,(t) => 0,[0, 4]], {strokeWidth: 2,strokeColor: 'goldenrod', dash: 2, name: 'y=0.5x'});\r\n\t\/\/ ajout des images \r\n\tconst img1=board.create(\"image\", ['\/personnalisation\/images\/XY.png', [6,-2.5], [1,0.5]],{fixed:true});\r\n\tconst img2=board.create(\"image\", ['\/personnalisation\/images\/XZ.png', [7,-2.5], [1,0.5]],{fixed:true});\r\n\tconst img3=board.create(\"image\", ['\/personnalisation\/images\/YZ.png', [8,-2.5], [1,0.5]],{fixed:true});\r\n\r\n\timg1.on(\"up\" , function() {view.setView(0,0); });\r\n\timg2.on(\"up\" , function() {view.setView(0,Math.PI\/2);});\r\n\timg3.on(\"up\" , function() {view.setView(Math.PI\/2,0);});\t\r\n\t\r\n  }\r\n\r\n\/\/ creation du board de controle \r\nboardCommandes.create(\"text\",[0,1,\"\\\\textrm{Pente}\"]);\r\nconst sl1=boardCommandes.create(\"slider\",[[2,1],[4,1],[2,1,10]],{snapWidth: 1,});\r\nboardCommandes.create(\"text\",[6,1,\"\\\\textrm{Niveaux}\"]);\r\nconst sl2=boardCommandes.create(\"slider\",[[8,1],[12,1],[2,0.5,10]],{snapWidth: 1,});\r\nsl1.on(\"up\",function(event) {\r\n  \/\/ on redessine l'ensemble du graphe en passant la pente \r\n  creation_environnement(sl1.Value(), sl2.Value());\r\n})\r\nsl2.on(\"up\",function(event) {\r\n  \/\/ on redessine l'ensemble du graphe en passant la pente \r\n  creation_environnement(sl1.Value(), sl2.Value());\r\n})\r\n\r\n\t\r\n\r\n\t\r\n\t\r\n\t\r\ncreation_environnement(sl1.Value(), sl2.Value());\r\n\r\n<\/script>\r\n\r\n\r\n ","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-10427","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/spgoo.org\/index.php?rest_route=\/wp\/v2\/pages\/10427","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/spgoo.org\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/spgoo.org\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/spgoo.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/spgoo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10427"}],"version-history":[{"count":1,"href":"https:\/\/spgoo.org\/index.php?rest_route=\/wp\/v2\/pages\/10427\/revisions"}],"predecessor-version":[{"id":10428,"href":"https:\/\/spgoo.org\/index.php?rest_route=\/wp\/v2\/pages\/10427\/revisions\/10428"}],"wp:attachment":[{"href":"https:\/\/spgoo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}