Solver FIND a line by slope and one point
Algebra
->
Coordinate Systems and Linear Equations
-> Solver FIND a line by slope and one point
Log On
Linear Solvers
Linear
Practice
Practice
Answers archive
Answers
Word Problems
Word
Lessons
Lessons
In depth
In
Source code of 'FIND a line by slope and one point'
This Solver (FIND a line by slope and one point)
was created by by
ichudov(507)
:
View Source
,
Show
,
Put on YOUR site
About ichudov
:
I am not a paid tutor, I am the owner of this web site!
==section input Find equation of a line going through point (*[input x1=2], *[input y1=1]) that has a slope of *[input slope=1]. ==section solution perl $yi = $y1 - $slope*$x1; print " What we know about the line whose equation we are trying to find out: <UL> <LI>it goes through point ($x1, $y1)</LI> <LI>it has a slope of $slope</LI> </UL> First, let's draw a diagram of the coordinate system with point ($x1, $y1) plotted with a little blue dot: {{{ drawing( 400, 400, -10, 10, -10, 10, grid(1), blue( circle( $x1, $y1, 0.2 ) ) ) }}} <B>Write this down</B>: the formula for the equation, given point {{{x[1], y[1]}}} and intercept a, is {{{y=ax + (y[1]-a*x[1])}}} (see a paragraph below explaining why this formula is correct) Given that a=$slope, and {{{system( x[1] = $x1, y[1] = $y1 ) }}}, we have the equation of the line: {{{y=$slope*x + $yi}}} Explanation: <I>Why did we use formula {{{y=ax + (y[1] - a*x[1])}}} ? Explanation goes here. We are trying to find equation y=ax+b. The value of slope (a) is already given to us. We need to find b. If a point ({{{x[1]}}}, {{{y[1]}}}) lies on the line, it means that it satisfies the equation of the line. So, our equation holds for ({{{x[1]}}}, {{{y[1]}}}): {{{y[1] = a*x[1]+b}}} Here, we know a, {{{x[1]}}}, and {{{y[1]}}}, and do not know b. It is easy to find out: {{{b=y[1]-a*x[1]}}}. So, then, the equation of the line is: {{{ y=ax+(y[1]-a*x[1]) }}}. </I> Here's the graph: {{{ drawing( 400, 400, -10, 10, -10, 10, grid(1), graph( 400, 400, -10, 10, -10, 10, $slope*x+$yi ), blue( circle( $x1, $y1, 0.2 ) ), locate( $x1, $y1, \"($x1, $y1)\" ) ) ) }}} "; ==section output yi ==section check x1=2 y1=1 slope=1 yi=-1 ==section practice $x1=randint( -5, 5 ); $y1=randint( -5, 5 ); $slope = randint( -2, 2 );