Trig / Lines / Coordinates [CS4/AS3]

Hey all,

Have a math/trig problem I’ve been working on for a little while and can’t seem to solve, was hoping somebody here might be able to.

I am working on an application which uses stage align top and no scale. Therefore the x axis coordinate system changes if the window is resized… 0 ends up not being the left edge. That is not a problem insofar as I can still locate the left edge with an equation.

My problem comes in the form of trying to draw a line, which may be easier to think of as the hypotenuse of a triangle. It needs to be drawn dynamically, because I will have no way of knowing what dimensions the user has their flash application at. Perhaps some examples will help.

Fig1

Fig2

Fig1 I can draw no problem. What I want to know is how to (on stage resize) determine new end points for line C (as in Fig2) – that maintains the same slope and position of the original line, simply extends the end points to the edge of the flash application.

Any help would be appreciated!