Lines: Slope-Intercept

Manipulate[
grtck=Range[-5,5];
Column[{Pane[Row[{Spacer [100]Text[If[showeqn,Style[Row[{Style["y",Italic]," = ",TraditionalForm[If[m==0,If[b==0,"0",""],If[usefractions,Rationalize[m],m]]],If[m==0,"",If[b>0,Row[{Style["x",Italic]," + "}],Style["x ",Italic]]],TraditionalForm[If[b==0,"",If[usefractions,Rationalize[b],b]]]}],20],Style["",20]]]}],ImageSize->{300,30}],

Plot[m*x+b,{x,-6,6},PlotStyle->{Red,Thick},AxesStyle->Thick,BaseStyle->{14},AspectRatio->Automatic,
PlotRange->{{-6,6},{-6,6}},Ticks->{grtck,grtck},GridLines->{grtck,grtck},ImageSize->300]
}],
{{usefractions,True,""},{True->"fractions",False->"decimals"},ControlType->RadioButtonBar,ControlPlacement->Top},
{{showeqn,True,Style["show equation",14]},{True,False},ControlPlacement->Left},"",
{{m,1.5,Style["slope m",14]},-15,15,If[usefractions,1/12,0.001],ImageSize->Medium,ControlPlacement->Top},
{{b,-1,Style["y-intercept b",14]},-6,6,If[usefractions,1/12,0.001],ControlType->VerticalSlider,ImageSize->{20,300},ControlPlacement->Left},RotateLabel->True,ControlPlacement->Left]

THIS NOTEBOOK IS THE SOURCE CODE FROM

"Lines: Slope-Intercept" from The Wolfram Demonstrations Project
 http://demonstrations.wolfram.com/LinesSlopeIntercept/

Contributed by: Abby Brown

A full-function Wolfram Mathematica 6 system is required to edit this notebook.
GET WOLFRAM MATHEMATICA 6 »

© The Wolfram Demonstrations Project & Contributors   |   Terms of Use   |   Make a new version of this Demonstration »