How to get perpendicular vectors given a line segm

Question:How to get point A, B , C, and D?if AB and CD are perpendicular to p0p1.Assume p0A, p0B, p1C, and p1D have normalized lengthAnswer1:The direction of the line is given by d = normalize(p1 - p0). To calculate a perpendicular vector we can use the c