Point positioning inside rectangle with only two known vertexes I'm working on a js widget, and I've come across a positioning problem, which I can't seem to solve with my limited geometry knowledge or by help of Wikipedia/google.

I have a quadrilateral rectangle, which is positioned at an angle. I know its two opposite vertexes and width/height ratio. And there's a point on it, which coordinates I also know. I need to find how far (in %s of width/height) is that point from rectangle's sides. Is it possible to do so?
Let $(x_0,y_0)$ the coords of the lowest point, and $(x_1,y_1)$ the coords of the highest.  Let also $\alpha$ the angfle formed by the line passing throught $(x_0,y_0)$ parallel to $h$. We can write the equation of this line as:
$$L_h: y-y_0=\tan(\alpha)(x-x_0)$$
Now, we have to find the equation of the line paasing throught $(x_1,y_1)$ and parallel to $w$. We have:
$$L_w: y-y_1=-\frac{1}{\tan(\alpha)}(x-x_1)$$
Let $(X,Y)$ the coords of the fixed point. Now, we have done, because we can use the distance formula. Let $\delta_h$ the distance of the fixed point from the line $L_h$, we have:
$$\delta_h=\frac{|\tan(\alpha)X-Y+y_0-\tan(\alpha)x_0|}{\sqrt{\tan^2(\alpha)+1}}$$
Let $\delta_w$ the distance of the fixed point from the line $L_w$, we have:
$$\delta_w=\frac{|-\frac{1}{\tan(\alpha)}X-Y+\frac{x_1}{\tan(\alpha)}+y_1|}{\sqrt{\left(\frac{1}{\tan(\alpha)}\right)^2+1}}$$
Let $(x_0,y_0)$ the coords of the lowest point, and $(x_1,y_1)$ the coords of the highest.  Let also $\alpha$ the angfle formed by the line passing throught $(x_0,y_0)$ parallel to $h$. We can write the equation of this line as:
$$L_h: y-y_0=\tan(\alpha)(x-x_0)$$
Now, we have to find the equation of the line paasing throught $(x_1,y_1)$ and parallel to $w$. We have:
$$L_w: y-y_1=-\frac{1}{\tan(\alpha)}(x-x_1)$$
Let $(X,Y)$ the coords of the fixed point. Now, we have done, because we can use the distance formula. Let $\delta_h$ the distance of the fixed point from the line $L_h$, we have:
$$\delta_h=\frac{|\tan(\alpha)X-Y+y_0-\tan(\alpha)x_0|}{\sqrt{\tan^2(\alpha)+1}}$$
Let $\delta_w$ the distance of the fixed point from the line $L_w$, we have:
$$\delta_w=\frac{|-\frac{1}{\tan(\alpha)}X-Y+\frac{x_1}{\tan(\alpha)}+y_1|}{\sqrt{\left(\frac{1}{\tan(\alpha)}\right)^2+1}}$$