for(var i = 1; i <=2; i++) {
var el = document.getElementById("box"+i);
el.classList.add('jxgbox');
/* You will have to do some random tuning of the margins and sizes as the default iframe might not have enough space.
el.style.width="48vw";
el.style.height="96vh"; */
el.style.width="460px";
el.style.height="260px";
}
/* qale de [10, 11, 12, 14, 15, 16, 18, 20, 21, 22
pted [1/2, 2/3, 3/4, 1, 5/4, 3/2, 4/3, 5/3, 2]] */
/* valores que vienen de STACK, aleatorios */
/* Para la demanda */
var qale = 12;
var pted = 5/4;
/* Para los costes */
var cflin = 20;
var blin = 5;
var cfcuad = cflin/2;
var bcuad = blin/10;
/* Definición de funciones */
var ctotlin = function(q){return cflin + blin * q};
var cmglin =function(q){return blin};
var cmelin = function(q){return ctotlin(q)/q};
var ctotcuad = function(q){return cfcuad + bcuad * q*q};
var cmgcuad =function(q){return 2*bcuad * q};
var cmecuad = function(q){return ctotcuad(q)/q};
var deminv = function(q){return (qale *pted + blin) - pted * q};
var demcv = qale *pted + blin;
var dem = function(p){return (demcv-p)/pted};
var demch = dem(0);
var itot = function(q){return q * deminv(q)};
var img = function(q){return (qale *pted + blin) - 2 * pted * q};
var beneflin = function(q){return q * deminv(q)- ctotlin(q)};
var benefcuad = function(q){return q * deminv(q)- ctotcuad(q)};
/* Dimensiones de las figuras */
var th = (1.7+Math.random()/3)*demch;
var tv =(1.2+Math.random()/3) *demcv;
var tv2 =(1.1+Math.random()/3) *itot(demch/2);
JXG.Options.axis.ticks.minorTicks = 0;
/* Primera figura. Funciones unitarias */
var board = JXG.JSXGraph.initBoard('box1', {boundingbox: [-0.1*th,tv,th,-0.15*tv] ,
axis: false,
grid: false,
showNavigation: false,
showCopyright:false,
pan: {enabled: false},
zoom: {enabled: false}});
var xaxis...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.