i have four coordinates and my formula is that i want from two points for example P1(-1|1) and P2(1|1) many points on this "connection or line". I have P3(1|-1) and P4(-1|-1)
so vector for two points is v = P1 + Lambda + (P2 -P1) for Lambda is [0:0.2:1] so i can make more points for this points and connected them.
But how can i transform this in matlab with a for-loop ?
I want only rectangle so the connection and calculation is possible for P1 and P2, P2 and P3, P3 and P4.
for i =1:4
for Lambda = 0:0.25:1;
v(index) = x(i),y(i) + Lambda * ( x(i+2),y(i+2) - (x(i),y(i)))
i tried this but i don't think that is right