clear all;     
clc; 
L1 = linspace(0,1,100);
L2 = linspace(0,1,100);
L3 = linspace(0,1,100);

daugh = [0 1 0.5;0 0 0.5];  %coordinates of nodes of daughter element

for i =1:100
    %from node 1 to node 2
    z = daugh*[L1(i); -L1(i)+1; 0];
    x1_2(i) = z(1);
    y1_2(i)= z(2);
    
   %from node 1 to node 3
    z = daugh*[L1(i); 0; -L1(i)+1];
    x1_3(i) = z(1);
    y1_3(i)= z(2);
    
    %from node 2 to node 3
    z = daugh*[0; L2(i); -L2(i)+1];
    x2_3(i) = z(1);
    y2_3(i)= z(2);
end

plot(x1_2,y1_2,'r', x2_3,y2_3,'b',x1_3, y1_3, 'g');