Posted: Thu Dec 16, 2004 8:45 am Post subject: 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 ! 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 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 !
code:
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
Sponsor Sponsor
Neo
Posted: Thu Dec 16, 2004 4:41 pm Post subject: Re: Equation of a line (y=Mx+b)
Token wrote:
y+Mx+b
Isn't this a term that almost every student from gr 9 all the way to 12 hates!
Actually, no.
Andy
Posted: Thu Dec 16, 2004 4:43 pm Post subject: (No subject)
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
Posted: Thu Dec 16, 2004 6:15 pm Post subject: (No subject)
5x5 matrix of heavysides 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
Posted: Thu Dec 16, 2004 7:23 pm Post subject: (No subject)
A verticle line should be in the form of x = b
Token
Posted: Thu Dec 16, 2004 10:09 pm Post subject: 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
Posted: Sun Dec 19, 2004 12:07 am Post subject: ..
Quote:
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
Andy
Posted: Sun Dec 19, 2004 5:19 pm Post subject: (No subject)
yes, the scalar eqn owns you and me too but shhhhh
Sponsor Sponsor
MihaiG
Posted: Mon Dec 20, 2004 6:35 pm Post subject: (No subject)
im in gr. 9 enriched... and we just finished with y = mx + b and started with Ax+By+C=0 he he he
Andy
Posted: Mon Dec 20, 2004 6:39 pm Post subject: (No subject)
enriched? what school?
MihaiG
Posted: Mon Dec 20, 2004 8:46 pm Post subject: (No subject)
why do you ask.......???
i got to Newmarket High
Pickles
Posted: Tue Dec 21, 2004 1:18 am Post subject: ...
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
Posted: Mon Feb 14, 2005 5:06 pm Post subject: (No subject)
ya well i'm in grade 10 and we just started learning Ax+By+C=0
Mr. T
Posted: Mon Feb 14, 2005 7:29 pm Post subject: (No subject)
my teacher made a calculator prog called solvesys which does all that dirty work for you
ssr
Posted: Mon Feb 14, 2005 8:51 pm Post subject: (No subject)
Token wrote:
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)