ok, well you need to tell it to do that. your eqyation is y - y1 = m * (x - x1) you need to show the program HOW to print the equation you want.
Code:
print "y-$cot=$hot(x-$pot) \n";
so this line. right now, it's printing text (a string) with every variable replaced with it's value. so of course it' going to print what it did. Programs ALWAYS do what you tell them to.
what YOU want to do is break this up into steps. you always want to print "y =" right?
and that will always be followed by your m value, followed by "x + " and then that last value. so you have every bit of information you need, except that last value. so, solve that generically,
$b = something
then change your print statement to be something like this:
Code:
print "y = $m x + $b \n"
and this is where I get to my OTHER issue with your code which is this. you need to give your variables meaningful names. pot, hot, and not have no meaning, so it's hard to read your code and understand what it's doing. if you're reading an x value call it X, or X1 or Xval or something. if you're reading hte slope, call it m, or slope. get the idea? hope that helped...