All pastes #427029 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-04-06 15:39 UTC
rendered paste body
on *:TEXT:!simpeqn *:#: {
  set %x1 $remove($gettok($2,1,44),$chr(40))
  set %x2 $remove($gettok($3,1,44),$chr(40))
  set %y1 $remove($gettok($2,2,44),$chr(41))
  set %y2 $remove($gettok($3,2,44),$chr(41))

  %y1simp = %y1 * -1
  %m = $calc((%y2 - %y1) /  (%x2 - %x1))
  %simp = $calc(( %m * %x1 ) + %y1simp )
  %eqn =  y = %m (x) -  %simp

  /msg $chan The equation of the line between $2 and $3 is: %eqn  
}