function addLine(slopeValue, interceptValue) {
    console.log("slopeValue:::" + slopeValue);
    console.log("interceptValue:::" + interceptValue);
    console.log(slopeValue == null);

    let para = document.createElement("P");
    let lineText = "y = " + slopeValue + "x + " + interceptValue;
    if (specialFlag){
        if(x2Val == 0){
            lineText = "x = 0";
        }else{
            lineText = "x = " + x2Val;
        }
    }else if((slopeValue == 0 || slopeValue == null) && (interceptValue == 0 || interceptValue == null)) {
        lineText = "y = 0";
    } else if (interceptValue == 0) {
        lineText = "y = " + slopeValue + "x";
    } else if (slopeValue == 0) {
        lineText = "y = " + interceptValue;
    }

    console.log("lineText:::" + lineText);
    var colorCircleDiv = document.createElement("div");
    colorCircleDiv.style.width = "20px";
    colorCircleDiv.style.height = "20px";
    colorCircleDiv.style.background = lineColors[lineNum % lineColors.length];

    let t = document.createTextNode(lineText);
    para.appendChild(colorCircleDiv);
    para.appendChild(t);
    lineList.appendChild(para);
}
// add the line equation to the list
add the line equation to the list
add the line equation to the list
function addLine(slopeValue, interceptValue) {
    console.log("slopeValue:::" + slopeValue);
    console.log("interceptValue:::" + interceptValue);
    console.log(slopeValue == null);
    let para = document.createElement("P");
    let lineText = "y = " + slopeValue + "x + " + interceptValue;
    if (specialFlag){
        if(x2Val == 0){
            lineText = "x = 0";
        }else{
            lineText = "x = " + x2Val;
        }
    }else if((slopeValue == 0 || slopeValue == null) && (interceptValue == 0 || interceptValue == null)) {
        lineText = "y = 0";
    } else if (interceptValue == 0) {
        lineText = "y = " + slopeValue + "x";
    } else if (slopeValue == 0) {
        lineText = "y = " + interceptValue;
    }
    console.log("lineText:::" + lineText);
    var colorCircleDiv = document.createElement("div");
    colorCircleDiv.style.width = "20px";
    colorCircleDiv.style.height = "20px";
    colorCircleDiv.style.background = lineColors[lineNum % lineColors.length];
    let t = document.createTextNode(lineText);
    para.appendChild(colorCircleDiv);
    para.appendChild(t);
    lineList.appendChild(para);
}
function addLine ( slopeValue , interceptValue ) { console . log ( "slopeValue:::" + slopeValue ) ; console . log ( "interceptValue:::" + interceptValue ) ; console . log ( slopeValue == null ) ; let para = document . createElement ( "P" ) ; let lineText = "y = " + slopeValue + "x + " + interceptValue ; if ( specialFlag ) { if ( x2Val == 0 ) { lineText = "x = 0" ; } else { lineText = "x = " + x2Val ; } } else if ( ( slopeValue == 0 || slopeValue == null ) && ( interceptValue == 0 || interceptValue == null ) ) { lineText = "y = 0" ; } else if ( interceptValue == 0 ) { lineText = "y = " + slopeValue + "x" ; } else if ( slopeValue == 0 ) { lineText = "y = " + interceptValue ; } console . log ( "lineText:::" + lineText ) ; var colorCircleDiv = document . createElement ( "div" ) ; colorCircleDiv . style . width = "20px" ; colorCircleDiv . style . height = "20px" ; colorCircleDiv . style . background = lineColors [ lineNum % lineColors . length ] ; let t = document . createTextNode ( lineText ) ; para . appendChild ( colorCircleDiv ) ; para . appendChild ( t ) ; lineList . appendChild ( para ) ; }
add the line equation to the list
add the line equation to the list