@Anonymous wrote:
I wish all parallelograms, p3 to be parallel to p1-> p2
I'm confused. One routine [from @john.uhden] marked as an accepted Solution makes [non-rectangular] parallelograms [the word used above] if the angle between the 3 points is not a right angle, but the other [from @Moshe-A] forces them to be rectangles. A point can't be "parallel to" a line, so I'm interpreting, but if the second half quoted above really means that p3 should be along a line perpendicular to the p1->p2 line, then the first half should instead say you want all rectangles, and @john.uhden's routine shouldn't be a Solution; if that's not what it means, then @Moshe-A's routine shouldn't be a Solution.
I also notice something about @Moshe-A's Solution that I wonder about. If the 3rd point [there called p2] does not form a right angle with the first 2 points [p0 & p1], but is within 10 degrees of doing so, the routine uses the diagonal distance from p1 to p2 as the length, but draws with that distance perpendicular to p0->p1. In this image, the yellow is what happens if p2 forms a right angle with p0->p1. The magenta p2 is the same distance from the p0->p1 line as the yellow p2 is, but farther than that from p1, and the result is s t r e t c h e d o u t longer because the distance is taken on the diagonal, and p2 ends up not being on the far end.

I was pushing the limit on the 10-degree variability to see what the result would be, but the same distortion happens to a lesser degree any time the angle formed is off from 90 degrees even slightly. If p2 doesn't form a right angle with p0->p1, should it be using the absolute [diagonal] distance like that, or should it be using the perpendicular distance from p2 to p0->p1? [If you're talking about land subdivisions, the difference could have significant legal consequences.]
Kent Cooper, AIA