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

you only need to find one displacement vector

Ah yes, this is true. Nice idea. I'll use this as well, thanks.

you won't really need to use sine/cosine, just tangent

But there's no builtin tangent function, which means I'll either have to use Math::Trig, or roll my own tan, in terms of sin and cos anyway, right? Or is there something I'm missing?

Replies are listed 'Best First'.
Re^3: Code refactoring: simple trig, but it's been so long.
by johnnywang (Priest) on Dec 30, 2004 at 05:11 UTC
    tan is just the slope:
    tan = (y2-y1)/(x2-x1)