# Solver Graphing Linear Equations

Algebra ->  Algebra  -> Linear-equations -> Solver Graphing Linear Equations      Log On

 Ad: Algebra Solved!™: algebra software solves algebra homework problems with step-by-step help! Ad: Algebrator™ solves your algebra problems and provides step-by-step explanations!

 Algebra: Linear Equations, Graphs, Slope Solvers Lessons Answers archive Quiz In Depth

### Source code of 'Graphing Linear Equations'

This Solver (Graphing Linear Equations) was created by by jim_thompson5910(28595)  : View Source, Show, Put on YOUR site
About jim_thompson5910: I charge \$2 a problem (for steps shown) or \$1 a problem for answers only. Email: jim_thompson5910@hotmail.com Website: http://www.freewebs.com/jimthompson5910/home.html

 ==section input Please choose which form you will use *[choice form standard slope-intercept]. For instance if you have a problem similar to {{{2x+3y=5}}} then choose "standard". If you have something similar to {{{y=2x+5}}} then choose "slope-intercept" Input the equation in standard form {{{Ax+By=C}}} *[input a=1]x+ *[input b=2]y= *[input c=3] or Enter your equation in slope-intercept form ({{{y=mx+b}}} form) y=*[input m_input=2]x + *[input b_input=1] note: make sure you choose the correct form from the drop box above. Also, if you have decimal coefficients, convert them to fractions. For instance, if you have {{{.2x+.1y=10}}}, then input it as {{{(1/5)x+(1/10)y=10}}} ==section solution perl sub clean{ @array=(); @hold=@array; @array=split(//,\$string); \$size=@array; for(\$i=0;\$i<3;\$i++) { for(\$count=0;\$count<\$size;\$count++) {if((\$array[\$count]=~/\+/)&&(\$array[\$count+1]=~/\-/)) { delete \$array[\$count]; }} for(\$count=0;\$count<\$size;\$count++) {if(((\$array[\$count]=~/\+/)&&(\$array[\$count+1]=~/\(/))&&(\$array[\$count+2]=~/\-/)) {delete \$array[\$count]; delete \$array[\$count+1]; }} for(\$count=0;\$count<\$size;\$count++) {if((\$array[\$count]=~/\-/)&&(\$array[\$count+1]=~/\+/)) { delete \$array[\$count+1]; }} for(\$count=0;\$count<\$size;\$count++) {if((\$array[\$count]=~/\-/)&&(\$array[\$count+1]=~/\-/)) {delete \$array[\$count]; \$array[\$count+1]="+";}} for(\$count=0;\$count<\$size;\$count++) {if(((\$array[\$count]=~/\-/)&&(\$array[\$count+1]=~/\(/))&&(\$array[\$count+2]=~/\-/)) {delete \$array[\$count+2]; \$array[\$count]="+"; }} for(\$count=0;\$count<\$size;\$count++) {if(((\$array[\$count]=~/\//)&&(\$array[\$count+1]=~/1/))&&((\$array[\$count+2]=~/\)/)&&(\$array[\$count+3]=~/\*/))) {delete \$array[\$count]; delete \$array[\$count+1]; delete \$array[\$count+2]; for(\$count1=\$count+2;\$count1>=0;\$count1--) {if(\$array[\$count1]=~/\(/) {delete \$array[\$count1]; \$count1=-1;} } }} for(\$count=0;\$count<\$size;\$count++) {if(((\$array[\$count]=~/\//)&&(\$array[\$count+1]=~/1/))&&(\$array[\$count+2]=~/\+/)) {delete \$array[\$count]; delete \$array[\$count+1]; }} for(\$count=0;\$count<\$size;\$count++) {if(((\$array[\$count]=~/\//)&&(\$array[\$count+1]=~/1/))&&(\$array[\$count+2]!~/\d/)) {delete \$array[\$count]; delete \$array[\$count+1]; }} } #\$string=@array; \$string=@hold; } sub invert{ \$temp=\$arr1[0]; \$arr1[0]=\$arr1[2]; \$arr1[2]=\$temp; return (\$arr1[0], "/", \$arr1[2]); } sub mult{ \$temp1=\$arr1[0]*\$arr2[0]; \$temp2=\$arr1[2]*\$arr2[2]; #\$temp1=\$numer1*\$numer2; #\$temp2=\$denom1*\$denom2; return (\$temp1,"/",\$temp2); } sub add{ if((\$arr1[2]!=\$arr2[2])&&((\$arr1[2]!=0)&&(\$arr2[2]!=0))) { for(\$count=1;\$count0) { \$arr1[0]=abs(\$arr1[0]); \$arr1[2]=abs(\$arr1[2]); } if((\$store<0)&&(\$arr1[2]<0)) { \$arr1[0]=0-\$arr1[0]; \$arr1[2]=abs(\$arr1[2]); } if(\$arr1[0]%\$arr1[2]==0) { \$quotient=\$arr1[0]/\$arr1[2]; return (\$quotient,"/",1); } } for (\$i=abs(\$arr1[0]*\$arr1[2]); \$i>1; \$i--) { if ((\$arr1[0]%\$i==0)&&(\$arr1[2]%\$i==0)) { \$arr1[0]/=\$i; \$arr1[2]/=\$i; \$j=\$i; } } return (\$arr1[0],"/",\$arr1[2]); } if(\$form eq 'standard') { ## special case # 1 if( (\$a eq '0') and (\$b eq '0') ) { print "You have an invalid standard form equation. Make sure at least one coefficient on the left side is nonzero."; goto END; } ## special case # 2 if( (\$a ne '0') and (\$b eq '0') ) { print "
{{{\$a*x = \$c}}}

"; print "
{{{x = \$c/(\$a)}}}

"; print "
{{{x = ",(\$c/(\$a)),"}}}

"; print "
This is the vertical line that cuts through ",(\$c/(\$a))," on the x-axis and the graph is shown below

"; my \$temp123 = \$c/(\$a); print "
{{{ drawing(500, 500, -10, 10, -10, 10,graph( 500, 500, -10, 10, -10, 10,0),line(\$temp123,100,\$temp123,-100))}}}

"; print "
The slope of this line is undefined. All vertical lines have an undefined slope since rise/run = x/0 and division by zero is undefined.

"; goto END; } ## special case # 3 if( (\$a eq '0') and (\$b ne '0') ) { print "
{{{\$b*y = \$c}}}

"; print "
{{{y = \$c/(\$b)}}}

"; print "
{{{y = ",(\$c/(\$b)),"}}}

"; print "
This is the horizontal line that cuts through ",(\$c/(\$b))," on the y-axis and the graph is shown below

"; my \$temp123 = \$c/(\$b); print "
{{{ drawing(500, 500, -10, 10, -10, 10,graph( 500, 500, -10, 10, -10, 10,0),line(-100,\$temp123,100,\$temp123))}}}

"; print "
The slope of this line is zero. All horizontal lines have slope of zero since rise/run = 0/x = 0.