On 10/23/07, camotito <[EMAIL PROTECTED]> wrote:
> I was just implementing this small program for calculating the line-
> equation, given two points.
> Just in case you don't remind this equation y = slope * x + b.
> First I calculate the slope and then b:
>
> $slope = ($ARGV[1] - $ARGV[3]) /
>
> $slope = ($ARGV[1] - $ARGV[3]) / ($ARGV[0] - $ARGV[2]);
> $b = $ARGV[1] - ($ARGV[0] * $slope);
> print "\n$ARGV[1] = $slope * $ARGV[0] + $b\n";
>
> For this input :
>
> perl my_program 16.81 16.57 0 0
>
> It gives me this result :
>
> 16.57 = 0.985722784057109 * 16.81 + 0
>
> Clearly