Given the following graph:

Where SP is the start point and EP is the end point of a line - how would I rotate p1 and p2 on axis SP in such a way that they would represent an isosceles triangle e.g.

Given the following graph:

Where SP is the start point and EP is the end point of a line - how would I rotate p1 and p2 on axis SP in such a way that they would represent an isosceles triangle e.g.

Copyright © 2021 JogjaFile Inc.
Calculate the distance between say $p_1$ and $SP$, $d = |SP - p_1|$. Suppose $v := EP - SP = (v_1, v_2)$. Then $n = (-v_2, v_1)$ is the direction you need to go in. Then your points are $SP \pm \frac{d n}{|n|}$