i’ll stand by what i posted (any potential typos from free-hand forum typing notwithstanding) - the accepted way to solve this class of problems is via the 2d rotation formula.
the only little “trick” in this particular problem’s wording is the translation of p1. ie, you must first remove the translation to p1 (that’s what dx/dy do) to put p2 back on the origin, then apply the 2d rotation (that’s the cosx-siny, cosy+sinx bit), then translate xy’ back to p1 (that’s the p1x+, p1y+ bit). still textbook stuff though.
BUT… that’s not to say that you can’t solve it other ways. (fe, get the original line’s angle and magnitude, add/sub the half angle, recreate the other lines via basic trig). however, that’s the long way to do it, and needs (at least) an additional atan2 for the angle, and a sqrt for the magnitude.
first quarter trig ought to still cover the angle sum rule, and from there it’s just a tiny step til you could derive the 2d rotation formula for yourself. (you don’t even need to know that you’re applying a matrix transform to a vector - you are, of course, but in 1st qtr trig you wouldn’t call it that yet)
a geometric solution is also possible, using similar triangles, but omg - once you grok the trig you’d never do it with plain geometry (btw, that’s a brilliant pun right there – too bad that few will appreciate it! :D)