I am creating line tool for sketchup and was running out of ideas of calculating the other point on a diamond. Essentially (with this line tool) you draw a line, and then at a set width, it creates a diamond shape based of the midpoints and the slope. I already calculated the first point using the midpoint, slope and distance. Now, i need to reflect that point over the line and find the other corner....I have found various formulas, but non are making sense. I was wondering if anyone here could help. Ill link to the 2 sources that I have actually tested, maybe im missing something.
http://mathworld.wolfram.com/Reflection.html
Algorithm for reflecting a point across a line
z = b - slope*a
var1 = (a + (m*(b-z)))
var2 = var1 / (1 + (slope**2))
xneg = 2*(var2) - a
yneg = 2*(var2)*slope - b + 2*z