GlossaryT.Inequality2 History

Hide minor edits - Show changes to markup - Cancel

September 09, 2009, at 05:25 AM by LFS -
Changed line 3 from:

Mathcasts         Examples      Practice    More      L

to:

Mathcasts         Examples      Practice    More      L

September 09, 2009, at 01:08 AM by LFS -
Added line 48:
Changed line 50 from:

document.ggbApplet.setVisible("mf", false);

to:

document.ggbApplet.setVisible("ms", false);

Changed lines 56-59 from:

document.ggbApplet.setVisible("eq1txt",false);
document.ggbApplet.setVisible("ineq1txt",false);

 

//replaces single sign with double sign

to:


    document.ggbApplet.setVisible("ineq1txt",false);

 

//replaces single sign with double sign to check for equality (solid line)

Changed lines 61-62 from:

// checks for "="

to:

//E1=E1.replace("X"g,"x");
//E1=E1.replace("Y"g,"y");

 

// checks for "=" and tells GGB via variable eq.

Changed lines 69-70 from:

// checks type of inequality
var ieq1=0;

to:

// checks if inequality sign and tells GGB via variable ineq.

Changed lines 71-86 from:


  if(Test2 != E1) {
    ieq1=1;
    } else {
Test2=E1.replace(">","SantaClaus");
  if(Test2 != E1) {
  ieq1=2;
  }
}
// not an inequality, check if equation
if (eq1 == 0 && ieq1==0) {
  alert('Write an inequality or an equation');return(false);
}
  document.ggbApplet.evalCommand("ieq="+ieq1);

 

//draw the line of the inequality twice (as md and mf in ggb file).
L1=E1.replace(/>/gi,"="); L1=L1.replace(/</gi,"=");

to:

Test3=E1.replace(">","SantaClaus");
  if(Test2 != E1 || Test3 != E1) {
    ineq1=1;
  } else {
    ineq1=0;
    // also - if no inequality, checks whether there is an "=" sign (if neither, it is stupid input)
    if(eq1==0){
  alert('Write an inequality or an equation.');
  return(false);
}  
  }
  document.ggbApplet.evalCommand("ineq="+ineq1);  

 

// replaces inequality with equality to draw the line of the inequality three times.
// a is always in slope-intercept form so coefficient of y is 1.
// md is dashed line and ms is solid line.
   //Hope to be able to use standard form on md and ms, but depending on input, ggb may switch sign of coefficients A and B (for same line) and thus cannot guarentee correct inequality.
L1=E1.replace(/>/gi,"=");
L1=L1.replace(/</gi,"=");

Changed lines 93-96 from:

document.ggbApplet.evalCommand("mf:"+L1);
var za= document.ggbApplet.getValue("za1");

 

//next if says make visible mf (solid) or md (dashed) depending on inequality.

to:

document.ggbApplet.evalCommand("ms:"+L1);

 

// LINETYPE - make visible mf (solid) or md (dashed) depending on "equality".

Deleted line 96:

document.ggbApplet.setVisible("mf", false);

Changed lines 99-100 from:

document.ggbApplet.setVisible("mf", true);
document.ggbApplet.setVisible("md", false);

to:

document.ggbApplet.setVisible("ms", true);

Changed lines 102-106 from:

// next if is for shading
  if(ieq1 != 0){
  //problem- checks for negative y coefficient in input since this reverses inequality
    if(za<=0){

to:

// SHADING
// if inequality in input ...
  if(ineq1 != 0){
    // gets the value of the slope as corner to be tested/shaded depends on slope
    var slopea = document.ggbApplet.getValue("slopea");

 


  //this is the algorithm key!! Replaces x and y in original inequality with bigN=10000 from corners to test. BLANKS ARE REQUIRED!!!
  //if slope is positive,  checks Corner[2] (IV Quad); else checks Corner[1] (III Quad).

Changed lines 112-117 from:

Testing1=E1.replace(/x/gi," (-100)");
Testing1=Testing1.replace(/y/gi," (-100)");
document.ggbApplet.evalCommand("zer="+Testing1);
    a1=document.ggbApplet.getValue("zerN");

 


    if(a1==1){

to:

TestCor=E1.replace(/y/gi," (-10000)");
    if(slopea>0){
  //if slope is positive - substitutes (Corner[2]=(10000,-10000) for (x,y) and checks truth of inequality.
  TestCor=TestCor.replace(/x/gi," (10000)");   
  document.ggbApplet.evalCommand("test="+TestCor);
  //test is boolean value in ggb; testN is number value
      testN=document.ggbApplet.getValue("testN");
      if(testN==1){
    document.ggbApplet.setVisible("Apoly2", true);
  } else {
       document.ggbApplet.setVisible("Apoly4", true);
  }
    } else {  
     //if slope is negative, 0 or undefined - substitutes (Corner[1]=(-10000,-10000) for (x,y) and checks truth of inequality.
    // BTW undefined slope is set to -bigN, since this makes testN consistent.
  TestCor=TestCor.replace(/x/gi," (-10000)");
  document.ggbApplet.evalCommand("test="+TestCor);
      testN=document.ggbApplet.getValue("testN");
      if(testN==1){

Changed line 132 from:


      }else{

to:


    } else {

Changed lines 134-148 from:


    }
    }else{

 

E1=E1.replace(">=","≥");
E1=E1.replace("<=","≤");
Testing1=E1.replace(/x/gi," (100)");
Testing1=Testing1.replace(/y/gi," (-100)");
document.ggbApplet.evalCommand("zer="+Testing1);
    a2=document.ggbApplet.getValue("zerN");

 

if(a2==1){
      document.ggbApplet.setVisible("Apoly2", true);
     } else {
          document.ggbApplet.setVisible("Apoly4", true);
     }

to:


  }

Deleted line 135:

//document.ggbApplet.setVisible("ineq1txt",true);

Changed lines 138-139 from:
to:


    document.ggbApplet.setVisible("ineq1txt",true);

Added lines 141-236:

 

function graph2(E1){

 

// turns everything off in ggb
document.ggbApplet.setVisible("msb", false);
document.ggbApplet.setVisible("mdb", false);
document.ggbApplet.setVisible("Bpoly1", false);
document.ggbApplet.setVisible("Bpoly2", false);
document.ggbApplet.setVisible("Bpoly3", false);
document.ggbApplet.setVisible("Bpoly4", false);
    document.ggbApplet.setVisible("ineq2txt",false);

 

//replaces single sign with double sign to check for equality (solid line)
E1=E1.replace("≥",">=");
E1=E1.replace("≤","<=");
//E1=E1.replace("X"g,"x");
//E1=E1.replace("Y"g,"y");

 

// checks for "=" and tells GGB via variable eq.
Test1=E1.replace("=","SantaClaus");
  if(Test1 == E1) {eq1=0} else {eq1=1};
  document.ggbApplet.evalCommand("eqb="+eq1);

 

// checks if inequality sign and tells GGB via variable ineq.
Test2=E1.replace("<","SantaClaus");
Test3=E1.replace(">","SantaClaus");
  if(Test2 != E1 || Test3 != E1) {
    ineq1=1;
  } else {
    ineq1=0;
    // also - if no inequality, checks whether there is an "=" sign (if neither, it is stupid input)
    if(eq1==0){
  alert('Write an inequality or an equation.');
  return(false);
}  
  }
  document.ggbApplet.evalCommand("ineqb="+ineq1);  

 

// replaces inequality with equality to draw the line of the inequality three times.
// a is always in slope-intercept form so coefficient of y is 1.
// md is dashed line and ms is solid line.
   //Hope to be able to use standard form on md and ms, but depending on input, ggb may switch sign of coefficients A and B (for same line) and thus cannot guarentee correct inequality.
L1=E1.replace(/>/gi,"=");
L1=L1.replace(/</gi,"=");
L1=L1.replace("==","=");
document.ggbApplet.evalCommand("b:"+L1);
document.ggbApplet.evalCommand("mdb:"+L1);
document.ggbApplet.evalCommand("msb:"+L1);

 

// LINETYPE - make visible mf (solid) or md (dashed) depending on "equality".
  if(eq1==0) {
document.ggbApplet.setVisible("mdb", true);
} else {
document.ggbApplet.setVisible("msb", true);
}

 

// SHADING
// if inequality in input ...
  if(ineq1 != 0){
    // gets the value of the slope as corner to be tested/shaded depends on slope
    var slopea = document.ggbApplet.getValue("slopeb");

 


  //this is the algorithm key!! Replaces x and y in original inequality with bigN=10000 from corners to test. BLANKS ARE REQUIRED!!!
  //if slope is positive,  checks Corner[2] (IV Quad); else checks Corner[1] (III Quad).
   E1=E1.replace(">=","≥");
E1=E1.replace("<=","≤");
TestCor=E1.replace(/y/gi," (-10000)");
    if(slopea>0){
  //if slope is positive - substitutes (Corner[2]=(10000,-10000) for (x,y) and checks truth of inequality.
  TestCor=TestCor.replace(/x/gi," (10000)");   
  document.ggbApplet.evalCommand("testb="+TestCor);
  //test is boolean value in ggb; testN is number value
      testN=document.ggbApplet.getValue("testbN");
      if(testN==1){
    document.ggbApplet.setVisible("Bpoly2", true);
  } else {
       document.ggbApplet.setVisible("Bpoly4", true);
  }
    } else {  
     //if slope is negative, 0 or undefined - substitutes (Corner[1]=(-10000,-10000) for (x,y) and checks truth of inequality.
    // BTW undefined slope is set to -bigN, since this makes testN consistent.
  TestCor=TestCor.replace(/x/gi," (-10000)");
  document.ggbApplet.evalCommand("testb="+TestCor);
      testN=document.ggbApplet.getValue("testbN");
      if(testN==1){
    document.ggbApplet.setVisible("Bpoly1", true);
    } else {
  document.ggbApplet.setVisible("Bpoly3", true);
  }
    }
  }
//end
    document.ggbApplet.setVisible("ineq2txt",true);

 

}

September 09, 2009, at 01:06 AM by LFS -
Changed line 26 from:


  <p style="margin-left:10px; margin-top:4px; margin-bottom:0px; text-indent:-10px; font-size:.8em;   color:#000099">1. In the input box below, type or paste in a linear inequality in 2 variables x and y. <span class="red_b">Hit Enter</span> and view the resulting region in the plane.</p>

to:


  <p style="margin-left:10px; margin-top:4px; margin-bottom:0px; text-indent:-10px; font-size:.8em;   color:#000099">1. In the input box below, type or paste in a linear inequality in 2 variables x and y. <span class="red_b">Hit Enter</span> and view the resulting region in the plane.<br>* You can type <span style="color:#FF0000"><= </span>for <span style="color:#FF0000">≤</span>   and   <span style="color:#FF0000">>= </span>for <span style="color:#FF0000">≥ </span>.</span></p>

September 09, 2009, at 01:00 AM by LFS -
Changed line 146 from:


          <param name="filename" value="http://mathcasts.org/gg/enliven/af/lines/inequality2/30/inequality2_0_30.ggb">

to:


          <param name="filename" value="http://mathcasts.org/gg/enliven/af/lines/inequality2/inequality2_0.ggb">

June 28, 2009, at 03:38 AM by LFS -
Changed line 245 from:

[]Zip for offline use - http://mathcasts.org/mtwiki/uploads/GlossaryT/inequality2.zip  

to:

|[]Zip - Completely Offline & School

January 28, 2009, at 11:58 AM by LFS -
Added lines 1-279:


Page last modified on September 09, 2009, at 05:25 AM