
-----------------------------------
Token
Thu Dec 16, 2004 8:45 am

Equation of a line (y=Mx+b)
-----------------------------------
y+Mx+b
Isn't this a term that almost every student from gr 9 all the way to 12 hates! how about when you have to find 4 of these equations to identify a shape! yes it can get to be a very long and drawn out process! so0o I created a program that does it for u :D! yes, very helpfull but you know what would be even more helpfull? a program that finds the reciprocal of the equation... its coming, give me time :P almost done just working on outputing the information to a .txt file. also it will include finding the midpoint of a line and the distance between any two points on the cartesian plane! well hope this helps :wink: !


var x, y, x1, x2, y1, y2, m : real

loop

    put "\n\nTo find the formula of the line"

    put "\nEnter the first coordinate."
    put "X: " ..
    get x1
    put "Y: " ..
    get y1

    put "\nEnter the seccond coordinate."
    put "X: " ..
    get x2
    put "Y: " ..
    get y2


    put "\nSlope for XY"
    put "M=Rise/Run"
    put "M= (Y2-Y1) / (X2-X1)"
    put "M= (", y2, "-", y1, ") / (", x2, "-", x1, ")"
    put "M= (", y2 - y1, ") / (", x2 - x1, ")"

    if y2 - y1 = 0 then
        put "This is a horosontal line."
        put "Y= 0X + ", y1
    elsif x2 - x1 = 0 then
        put "This is a vertical line."
        put "Y= 0X "
    else

        put "M= ", (y2 - y1) / (x2 - x1)


        m := (y2 - y1) / (x2 - x1)
        x := x1
        y := y1

        put "\n Formula of the line"
        put "Y=M X + b"
        put y, "=", m, " (", x, ")+b"
        put y, "=", m * x, "+b"
        put y, "+", m * x, "=", m * x, "-", m * x, "+b"
        put y + (m * x), "= b"
        put "b=", y + (m * x)
        put "Therefore Y=", m, "X +", y + (m * x)
    end if

end loop


-----------------------------------
Neo
Thu Dec 16, 2004 4:41 pm

Re: Equation of a line (y=Mx+b)
-----------------------------------
y+Mx+b
Isn't this a term that almost every student from gr 9 all the way to 12 hates!


Actually, no.

-----------------------------------
Andy
Thu Dec 16, 2004 4:43 pm


-----------------------------------
err who uses y=mx+b nymore... Ax+By+C=0 is the way to go... get use to it or ur gona flunk algebra

-----------------------------------
Tony
Thu Dec 16, 2004 6:15 pm


-----------------------------------
5x5 matrix of heavysides :shock: actually my algebra exam was awesome, I think I aced it... though you never now. I had to reinvent the way you check if vectors are colinear or not because damn it, it's hard to sketch out 4D on paper to check visually

anyways, good idea for the program, but it's buggy.

first set: 1/1
second set: 2/2
the equation is most defenatly not y= x + 2 :?

-----------------------------------
Martin
Thu Dec 16, 2004 7:23 pm


-----------------------------------
A verticle line should be in the form of x = b

-----------------------------------
Token
Thu Dec 16, 2004 10:09 pm

cool
-----------------------------------
Hey everyone, thanks for the feedback, this was my first post in compsci and its cool to see how fast everyone responds. umm ya it is a little buggy, usually only with the vertical and horosontal lines tho, my math mark is only a 72 tho so it could be my bad. umm ya at my school (in gr 10) were still using t=Mx+b, its an academic class and my teacher said we'll keep using it all through highschool. I'll look over my notes and see if i can fix up the horosontal and vertical lines if anyone has any ideas why its not working feel free to edit the code other than that thanks for your feedback and its nice working with u guys (and girls, although theyre few and far between)

-----------------------------------
Pickles
Sun Dec 19, 2004 12:07 am

..
-----------------------------------
err who uses y=mx+b nymore... Ax+By+C=0 is the way to go... get use to it or ur gona flunk algebra


Hooray for G&D.. I love you Ax+By+Cz+D=0  :heart:

-----------------------------------
Andy
Sun Dec 19, 2004 5:19 pm


-----------------------------------
yes, the scalar eqn owns you and me too but shhhhh

-----------------------------------
MihaiG
Mon Dec 20, 2004 6:35 pm


-----------------------------------
im in gr. 9 enriched... and we just finished with y = mx + b and started with Ax+By+C=0 he he he

-----------------------------------
Andy
Mon Dec 20, 2004 6:39 pm


-----------------------------------
enriched? what school?

-----------------------------------
MihaiG
Mon Dec 20, 2004 8:46 pm


-----------------------------------
why do you ask.......???
i got to Newmarket High

-----------------------------------
Pickles
Tue Dec 21, 2004 1:18 am

...
-----------------------------------
I dont recall ever using Ax+By+C=0 for the equation of a line until this year in G&D (although i know i learned it somewhere along the lines) hmm. Scalar equations of a plane is fun, that and solving the intersection of three planes.. such boring work

-----------------------------------
Token
Mon Feb 14, 2005 5:06 pm


-----------------------------------
ya well i'm in grade 10 and we just started learning Ax+By+C=0

-----------------------------------
Mr. T
Mon Feb 14, 2005 7:29 pm


-----------------------------------
my teacher made a calculator prog called solvesys which does all that dirty work for you  :wink:

-----------------------------------
ssr
Mon Feb 14, 2005 8:51 pm


-----------------------------------
ya well i'm in grade 10 and we just started learning Ax+By+C=0
just started?
umm I thought every school in Canda teaches that in gr. 9
ummm 8)

-----------------------------------
Andy
Mon Feb 14, 2005 10:16 pm


-----------------------------------
my teacher made a calculator prog called solvesys which does all that dirty work for you  :wink:

yea well thats built in my calculator

-----------------------------------
Drakain Zeil
Mon Feb 14, 2005 10:40 pm


-----------------------------------
ya well i'm in grade 10 and we just started learning Ax+By+C=0
just started?
umm I thought every school in Canda teaches that in gr. 9
ummm 8)Yeah... over here too... Line stuff was wayyy back.

-----------------------------------
[Gandalf]
Wed Feb 16, 2005 5:02 pm


-----------------------------------
"Ax+By+C=0 is the way to go"
eeaeeae, I hate standard notation - y = mx + b is much easier IMO.  In my grade 9 math class we did like grade 10/11 stuff   :shock:  :) .  I guess that's why I got a 70% even though I sortof consider myself good in math...  :wink:

-----------------------------------
Drakain Zeil
Wed Feb 16, 2005 8:54 pm


-----------------------------------
y=mx+b to standard form really isn't that complex... 

It's just moving things to one side, and equating to zero.

Then there's some funky rules like... a can't be negative or something.

No decimals either.

Idealy, just mulyiply the entire thing by the "run" of m, then isolate for zero, if a is negative then multiply through a negative, and you're done.

-----------------------------------
ssr
Wed Feb 16, 2005 9:04 pm


-----------------------------------
Yes I like y-intercept form better too, 
and A cant be 0 thats also valid
but what do u mean it cant be a decimal No decimals either. 
 :?:  :?:  8)
