Hey,

i am trying to draw a perpindecular line to some existing line, like shown below:

I start with two points A and B that form a line, and calculate point C like so:

C.x = (A.x + B.x) / 2;

C.y = (A.y + B.y) / 2;

Now how could I calculate D?

I know I could just draw my line again and rotate it by 90° degrees but I would like to get it working without this little cheat ;)

Any help really appreciated, I guess its not that hard but I dont see it ...

Cheers

i am trying to draw a perpindecular line to some existing line, like shown below:

I start with two points A and B that form a line, and calculate point C like so:

C.x = (A.x + B.x) / 2;

C.y = (A.y + B.y) / 2;

Now how could I calculate D?

I know I could just draw my line again and rotate it by 90° degrees but I would like to get it working without this little cheat ;)

Any help really appreciated, I guess its not that hard but I dont see it ...

Cheers

1