in reply to Re^2: Code refactoring: simple trig, but it's been so long.
in thread Code refactoring: simple trig, but it's been so long.

tan is just the slope:
tan = (y2-y1)/(x2-x1)