I'm trying to lengthen a line, by a certain amount. I want to apply the modification to both points on the line, expanding it in both directions. without moving it from it's current position (center point expansion would be acceptable, but I'n not sure how to apply it).
Point 1 [X = 1 , Y = 4], Point 2 [X = -1, Y = 6]
Line Normalized Vector: V = [X = -0.707106, Y = 0.707106]
Expand by: E = 1
So the result I'm looking for is
New Line = [ 1.707 , 4.707 ] ~ [ -1.707 , 6.707 ]
My problem happens when I multiply Point2[X] + ((0-V[x])*E) = - 0.292
Can someone give a SIMPLE example. Psudo code, is great!
I know it is because I'm crossing the zero line, but I'm sure there's a better way to do this than testing if the point is greater than zero or less than zero.