A vector perpendicular to (a,b) is (-b,a). This one can prove by the help of scalar product (also named dot product).

In your case (a,b)= (x2,y2)-(x1,y1). Now, with this (-b,a) vector one can easily calculate the four (?,?) vectors respectively their “representants” (sorry I do not find the right word in English).

Because (?,?) is not specified more precise, I personally would use the above mentioned calculations. Another way is to use “unit vector” for (-b,a), but in case of graphics one has to pay attention, not to lose precisions.

Sorry for my bad English, I hope it helps.

It is simple vector computation. Even if others here think it is more.

15,741,818 members

In your case (a,b)= (x2,y2)-(x1,y1).

Now with this (-b,a) vector one can easily calculate the four (?,?) vectors respectively their representants.

—SA

—SA