GMLscripts.com

line_get_slope

line_get_slope(x1,y1,x2,y2)
Returns the slope of the given line.
COPY
  1. /// line_get_slope(x1,y1,x2,y2)
  2. //
  3. // Returns the slope of the given line. If (x1 == x2),
  4. // this function will cause a divide by zero error.
  5. //
  6. // x1, y1 1st point
  7. // x2, y2 2nd point
  8. //
  9. /// GMLscripts.com/license
  10. {
  11. return ( (argument3 - argument1) / (argument2 - argument0) );
  12. }

Contributors: Leif902

GitHub: View · Commits · Blame · Raw