Hello all,
I am trying to built an one line diagram of power system ie I have lines that depicts buses, transmission lines in my figure. Then I used meshgrid to divide my figure space into 100x100 points. (I guess now I have 10000 points in my figure). Now, I need to find out the distance of each of these 10000 points from the bus ie from the lines that depicts my buses. However, I am not able to access all the 10000 poins, only one fourth of the points are accessible.
[X,Y]= meshgrid(1:100, 1:100);
for ix=1:100
for iy=1:100
for i=1:30
dist(iy,i)=abs(xyb(2*i,1)- xyb((2*i-1),1)*(xyb((2*i-1),2)-Y(iy,1))-(xyb((2*i-1),1)-X(1,ix))*(xyb(2*i,2)-xyb((2*i-1),2)))/abs(xyb(2*i,1)-xyb((2*i-1),1));
end
end
end
Here
xyb= 30x2 matrice storing bus coordinate, I have 30 bus. Element 1,2 gives me the y coordinate of first bus, n 1 ,1 gives me the x coordinate.
Y= y coordinate for the particular point from where I need the distance to the buses. This is the meshgrid result.
I am trying to follow this formula for distance
=abs( (X2 -X1)(Y1- Y0 ) – (X1 - X 0)(Y2-Y1))/ abs(X2 -X1)
For me y2 and y1 is same. an somebody please tell me, how to access all the points in the meshgrid plot!