Skip to content

Instantly share code, notes, and snippets.

@hrpunio hrpunio/pathdiag.mp
Created Oct 26, 2011

Embed
What would you like to do?
%% Rysowanie diagramow sciezkowych w programie MetaPost
%% *** (c) T.Przechlewski 2009 ***
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%
%% zmienna mierzalna:
ux := 1mm ; %% jednostka
%%
rwd:=5ux; %% szerokosc prostokata
rht:=3ux; %% wysokosc prostokata
err:=4ux; %% dlugosc strzalki oznaczajacej blad
%% czynniki:
circle_diam := 9ux; %% srednica
corr_d_err :=1.5ux; %% korekta `skosnosci' na strzalke bledu
pair ex_shift; ex_shift = (1ux,0ux); %% dodatkowy parametr (patrz nizej)
%%
loading_pos := .72 ;
path_coeff_pos := .4 ;
%% Rysuje zmienna mierzalna (bez bledu pomiaru):
def Rectangle (expr z, s) =
%% z -- srodek prostokata; s -- etykieta
path r ;
r = (-rwd,rht)--(rwd,rht)--(rwd,-rht)--(-rwd,-rht)--cycle ;
draw r shifted z;
label(TEX(s), z );
enddef;
%% Rysuje zmienna mierzalna (z bledem pomiaru):
def ErRectangle (expr z, s, e, pos) =
%% z -- srodek prostokata; s -- etykieta; e -- etykieta bledu; pos -- pozycja
path r ;
r = (-rwd,rht)--(rwd,rht)--(rwd,-rht)--(-rwd,-rht)--cycle ;
pair jj, kk;
draw r shifted z;
if pos="l":
jj = (-rwd, 0); kk = jj - (err ,0);
drawarrow (kk -- jj) shifted z;
label.top(TEX(e), kk shifted z );
elseif pos="r":
jj = (rwd, 0); kk = jj + (err ,0);
drawarrow (kk -- jj) shifted z;
label.top(TEX(e), kk shifted z );
elseif pos="b":
jj = (0, -rht); kk = jj - (0, err);
drawarrow (kk -- jj) shifted z;
label.lft(TEX(e), kk shifted z );
fi;
label(TEX(s), z );
enddef;
%% Rysuje czynnik (bez bledu pomiaru):
def Circle (expr z, s) =
%% z -- srodek prostokata; s -- etykieta
draw fullcircle scaled circle_diam shifted z;
label(TEX(s), z );
enddef;
%% Rysuje czynnik (z bledem pomiaru):
def ErCircle (expr z, s, d, pos) =
%% z -- srodek prostokata; s -- etykieta; d -- etykieta bledu; pos -- pozycja
draw fullcircle scaled circle_diam shifted z;
pair jj, kk;
jj = z + (0, .5 circle_diam);
if pos="r":
kk = jj + (+corr_d_err, err);
drawarrow (kk -- jj) shifted ex_shift;
label.rt(TEX(d), kk ) shifted ex_shift;
elseif pos="b":
kk = jj + (-corr_d_err, err);
drawarrow (kk -- jj) shifted -ex_shift;
label.rt(TEX(d), kk ) shifted -ex_shift;
fi;
label(TEX(s), z );
enddef;
%% Rysuje prosta od czynnika do miary
def CircleToRectangle(expr r,c, l) =
%% r,c -- srodki czynnika i miary
path rr, cc, uu;
rr = ((-rwd,rht)--(rwd,rht)--(rwd,-rht)--(-rwd,-rht)--cycle) shifted r ;
%% ** lepszy byłby środek boku, ale to wymaga rozważenia położenia prostokąta wzg koła **
cc = fullcircle scaled circle_diam shifted c ;
uu = r -- c;
pair jp_x, jp_y, pp, qq;
jp_x = rr intersectionpoint uu;
jp_y = cc intersectionpoint uu;
drawarrow jp_y -- jp_x;
pair lp; lp = loading_pos [jp_y, jp_x];
label.rt(TEX(l), lp );
enddef;
%% Rysuje prosta od miary do czynnika (casue indicator)
def RectangleToCircle(expr r,c, l) =
%% r,c -- srodki czynnika i miary
path rr, cc, uu;
rr = ((-rwd,rht)--(rwd,rht)--(rwd,-rht)--(-rwd,-rht)--cycle) shifted r ;
cc = fullcircle scaled circle_diam shifted c ;
uu = r -- c;
pair jp_x, jp_y, pp, qq;
jp_x = rr intersectionpoint uu;
jp_y = cc intersectionpoint uu;
drawarrow jp_x -- jp_y;
pair lp; lp = loading_pos [jp_y, jp_x];
label.rt(TEX(l), lp );
enddef;
%% Rysuje prosta od czynnika do czynnika
def CircleToCircle(expr r, c, rep, l ) =
%% r,c -- srodki czynnikow
%% rep -- jeżeli rep jest różne od "" zawiera symbol dla relacji zwrotnej
%% wpisz "NUL" jeżeli nie ma być symbolu relacji zwrotnej
%% l -- symbol relacji, jeżeli "" nie wpisuje nic
%% symbole są umieszczane w punkcie równym path_coeff_pos odpowiednich strzałek
path rr, cc, uu;
rr = fullcircle scaled circle_diam shifted r ;
cc = fullcircle scaled circle_diam shifted c ;
uu = r -- c;
pair jp_x, jp_y, pp, qq;
jp_x = rr intersectionpoint uu;
jp_y = cc intersectionpoint uu;
if (ypart jp_x) = (ypart jp_y): xshift := 0ux; else: xshift := 1ux; fi;
if (xpart jp_x) = (xpart jp_y): yshift := 0ux; else: yshift := 1ux; fi;
%% rep zawiera symbol
if rep <> "":
path jjk ; jjk = (jp_x -- jp_y) shifted (xshift, yshift); drawarrow jjk;
if rep <> "NUL":
pair lpx; lpx = point path_coeff_pos of jjk;
label.rt(TEX(rep), lpx );
fi
fi;
path jjl; jjl = jp_y -- jp_x; drawarrow jjl;
pair lp; lp = point path_coeff_pos of jjl;
label.rt(TEX(l), lp );
enddef;
%%
%% Rysuje obustronna strzalke od czynnika do czynnika
def CurrCircleToCircle(expr r, c, d, s) =
%% r,c -- srodki czynnikow;
%% d -- wygiecie linii (wstaw kat w stopniach)
%% s -- symbol relacji (jeżeli "" nie jest umieszczany)
path rr, cc, uu;
rr = fullcircle scaled circle_diam shifted r ;
cc = fullcircle scaled circle_diam shifted c ;
uu = r -- c;
pair jp_x, jp_y, pp, qq;
jp_x = rr intersectionpoint uu;
jp_y = cc intersectionpoint uu;
path corr ; corr = jp_y {dir d}.. jp_x ;
drawdblarrow corr;
if s <> "":
pair zzp;
zzp = point .5 of corr ;
label.top(TEX(s), zzp );
fi
enddef;
%%
%% Rysuje obustronna strzalke od miary do miary
def CurrRectangleToRectangle(expr r, c, d, pos) =
%% r,c -- srodki miar; d -- wygiecie linii (kat w stopniach)
pair jp_x, jp_y;
if pos="b":
jp_x = (0,-rht) shifted r; jp_y = (0,-rht) shifted c;
drawdblarrow jp_y {dir d}.. jp_x;
elseif pos="t":
jp_x = (0,rht) shifted r; jp_y = (0,rht) shifted c;
drawdblarrow jp_y {dir d}.. jp_x;
fi;
enddef;
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%
vardef TEX primary s =
%%%write "verbatimtex \input lcdpl.tex \input 8pt.tex etex;" to "mptextmp.mp";
write "btex "&s&" etex" to "mptextmp.mp";
write EOF to "mptextmp.mp";
scantokens "input mptextmp"
enddef;
%%
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%
%% Model jednoczynnikowy
rwd:=4.25ux;
zz:=10ux; %% odstęp między miarami
zl:=22ux; %% odstęp między czynnikami
%%Model pięcioczynnikowy ze swobodnie korelującymi czynnikami
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%
beginfig(6) %% pathdiagex2.mps
fff := 24ux;
path_coeff_pos := .4 ;
%% czynnik #1
z1 = (40ux,25ux); Circle(z1, "$\xi_1$");
mc := x1 - fff;
%%z15 = (mc +4ux,0ux); ErRectangle(z15, "$x_1$", "$\epsilon_1$", "l"); CircleToRectangle(z15,z1, "$\lambda_1$");
z10 = (mc,10ux); ErRectangle(z10, "$x_1$", "$\delta_1$", "l"); CircleToRectangle(z10,z1, "$\lambda_1$");
z11 = (mc,20ux); ErRectangle(z11, "$x_2$", "$\delta_2$", "l"); CircleToRectangle(z11,z1, "$\lambda_2$");
z12 = (mc,30ux); ErRectangle(z12, "$x_3$", "$\delta_3$", "l"); CircleToRectangle(z12,z1, "$\lambda_3$");
z13 = (mc +4ux,40ux); ErRectangle(z13, "$x_4$", "$\delta_4$", "l"); CircleToRectangle(z13,z1, "$\lambda_4$");
%% czynnik #2
z9 = (40ux,5ux); Circle(z9, "$\xi_2$");
mc := x9 + fff;
loading_pos := .55 ;
z95 = (10ux,-10ux); ErRectangle(z95, "$x_{5}$", "$\delta_{5}$", "b"); CircleToRectangle(z95,z9, "$\lambda_{5}$");
z96 = (25ux,-10ux); ErRectangle(z96, "$x_{6}$", "$\delta_{6}$", "b"); CircleToRectangle(z96,z9, "$\lambda_{6}$");
z97 = (40ux,-10ux); ErRectangle(z97, "$x_{7}$", "$\delta_{7}$", "b"); CircleToRectangle(z97,z9, "$\lambda_{7}$");
z98 = (55ux,-10ux); ErRectangle(z98, "$x_{8}$", "$\delta_{8}$", "b"); CircleToRectangle(z98,z9, "$\lambda_{8}$");
%% czynnik #2
z2 = (80ux,25ux); ErCircle(z2, "$\eta_1$", "$\zeta_1$", "r");
mc := x2 + fff;
loading_pos := .5 ;
%%z25 = (mc -4ux,0ux); ErRectangle(z25, "$x_6$", "$\epsilon_6$", "r"); CircleToRectangle(z25,z2, "$\lambda_6$");
z20 = (mc,10ux); ErRectangle(z20, "$x_9$", "$\epsilon_{9}$", "r"); CircleToRectangle(z20,z2, "$\lambda_{9}$");
z21 = (mc,20ux); ErRectangle(z21, "$x_{10}$", "$\epsilon_{10}$", "r"); CircleToRectangle(z21,z2, "$\lambda_{10}$");
z22 = (mc,30ux); ErRectangle(z22, "$x_{11}$", "$\epsilon_{11}$", "r"); CircleToRectangle(z22,z2, "$\lambda_{11}$");
z23 = (mc -4ux,40ux); ErRectangle(z23, "$x_{12}$", "$\epsilon_{12}$", "r"); CircleToRectangle(z23,z2, "$\lambda_{12}$");
%% czynnik #3
z3 = (80ux,5ux); ErCircle(z3, "$\eta_2$", "$\zeta_2$", "b");
loading_pos := .55 ;
z35 = (70ux,-10ux); ErRectangle(z35, "$x_{13}$", "$\epsilon_{13}$", "b"); CircleToRectangle(z35,z3, "$\lambda_{13}$");
z36 = (85ux,-10ux); ErRectangle(z36, "$x_{14}$","$\epsilon_{14}$","b"); CircleToRectangle(z36,z3, "$\lambda_{14}$");
z37 = (98ux,-10ux); ErRectangle(z37, "$x_{15}$","$\epsilon_{15}$","b"); CircleToRectangle(z37,z3, "$\lambda_{15}$");
z38 = (106ux,0ux); ErRectangle(z38, "$x_{16}$","$\epsilon_{16}$","b"); CircleToRectangle(z38,z3, "$\lambda_{16}$");
CurrCircleToCircle(z1, z9, 120, "$\phi_{21}$"); %% nieanalizowana zależność
CircleToCircle(z2,z1, "", "$\gamma_{11}$"); %% z1 = \epsilon_1, z2 = \eta_1
CircleToCircle(z2,z9, "", "$\gamma_{21}$"); %% z9 = \epsilon_2, z3 = \eta_2
CircleToCircle(z3,z9, "", "$\gamma_{22}$");
path_coeff_pos := .5 ;
CircleToCircle(z3,z2, "{}", "$\beta_{12}$");
label.rt(TEX("$\beta_{21}$"), (82ux,17ux));
endfig;
beginfig(5) %% pathdiagex.mps
fff := 24ux;
path_coeff_pos := .4 ;
%% czynnik #1
z1 = (40ux,25ux); Circle(z1, "$\xi_1$" );
mc := x1 - fff;
%%z15 = (mc +4ux,0ux); ErRectangle(z15, "$x_1$", "$\epsilon_1$", "l"); CircleToRectangle(z15,z1, "$\lambda_1$");
z10 = (mc,10ux); ErRectangle(z10, "$x_1$", "$\delta_1$", "l"); CircleToRectangle(z10,z1, "$\lambda_1$");
z11 = (mc,20ux); ErRectangle(z11, "$x_2$", "$\delta_2$", "l"); CircleToRectangle(z11,z1, "$\lambda_2$");
z12 = (mc,30ux); ErRectangle(z12, "$x_3$", "$\delta_3$", "l"); CircleToRectangle(z12,z1, "$\lambda_3$");
z13 = (mc +4ux,40ux); ErRectangle(z13, "$x_4$", "$\delta_4$", "l"); CircleToRectangle(z13,z1, "$\lambda_4$");
%% czynnik #2
z9 = (40ux,5ux); Circle(z9, "$\xi_2$" );
mc := x9 + fff;
loading_pos := .55 ;
z95 = (10ux,-10ux); ErRectangle(z95, "$x_{5}$", "$\delta_{5}$", "b"); CircleToRectangle(z95,z9, "$\lambda_{5}$");
z96 = (25ux,-10ux); ErRectangle(z96, "$x_{6}$", "$\delta_{6}$", "b"); CircleToRectangle(z96,z9, "$\lambda_{6}$");
z97 = (40ux,-10ux); ErRectangle(z97, "$x_{7}$", "$\delta_{7}$", "b"); CircleToRectangle(z97,z9, "$\lambda_{7}$");
z98 = (55ux,-10ux); ErRectangle(z98, "$x_{8}$", "$\delta_{8}$", "b"); CircleToRectangle(z98,z9, "$\lambda_{8}$");
%% czynnik #2
z2 = (80ux,25ux); ErCircle(z2, "$\eta_1$", "$\zeta_1$", "r");
mc := x2 + fff;
loading_pos := .5 ;
%%z25 = (mc -4ux,0ux); ErRectangle(z25, "$x_6$", "$\epsilon_6$", "r"); CircleToRectangle(z25,z2, "$\lambda_6$");
z20 = (mc,10ux); ErRectangle(z20, "$x_9$", "$\epsilon_9$", "r"); CircleToRectangle(z20,z2, "$\lambda_9$");
z21 = (mc,20ux); ErRectangle(z21, "$x_{10}$", "$\epsilon_{10}$", "r"); CircleToRectangle(z21,z2, "$\lambda_{10}$");
z22 = (mc,30ux); ErRectangle(z22, "$x_{11}$", "$\epsilon_{11}$", "r"); CircleToRectangle(z22,z2, "$\lambda_{11}$");
z23 = (mc -4ux,40ux); ErRectangle(z23, "$x_{12}$", "$\epsilon_{12}$", "r"); CircleToRectangle(z23,z2, "$\lambda_{12}$");
%% czynnik #3
z3 = (80ux,5ux); ErCircle(z3, "$\eta_2$", "$\zeta_2$", "b");
loading_pos := .55 ;
z35 = (70ux,-10ux); ErRectangle(z35, "$x_{13}$", "$\epsilon_{13}$", "b"); CircleToRectangle(z35,z3, "$\lambda_{13}$");
z36 = (85ux,-10ux); ErRectangle(z36, "$x_{14}$","$\epsilon_{14}$","b"); CircleToRectangle(z36,z3, "$\lambda_{14}$");
z37 = (98ux,-10ux); ErRectangle(z37, "$x_{15}$","$\epsilon_{15}$","b"); CircleToRectangle(z37,z3, "$\lambda_{15}$");
z38 = (106ux,0ux); ErRectangle(z38, "$x_{16}$","$\epsilon_{16}$","b"); CircleToRectangle(z38,z3, "$\lambda_{16}$");
CircleToCircle(z2,z1, "", "$\gamma_{11}$"); %% z1 = \epsilon_1, z2 = \eta_1
CircleToCircle(z2,z9, "", "$\gamma_{21}$"); %% z9 = \epsilon_2, z3 = \eta_2
CircleToCircle(z3,z9, "", "$\gamma_{22}$");
path_coeff_pos := .5 ;
CircleToCircle(z3,z2, "", "$\beta_{12}$");
endfig;
beginfig(7) %% indicators_ex.mps
fff := 24ux;
corr_d_err :=-1ux;
%% czynnik #1
z1 = (40ux,20ux); Circle(z1, "$\eta_1$");
mc := x1 - fff;
z15 = (mc +8ux,0ux); ErRectangle(z15, "$x_1$", "$\epsilon_1$", "l"); CircleToRectangle(z15,z1, "$\lambda_1$");
z10 = (mc,10ux); ErRectangle(z10, "$x_2$", "$\epsilon_2$", "l"); CircleToRectangle(z10,z1, "$\lambda_2$");
z11 = (mc,20ux); ErRectangle(z11, "$x_3$", "$\epsilon_3$", "l"); CircleToRectangle(z11,z1, "$\lambda_3$");
z12 = (mc,30ux); ErRectangle(z12, "$x_4$", "$\epsilon_4$", "l"); CircleToRectangle(z12,z1, "$\lambda_4$");
z13 = (mc +8ux,40ux); ErRectangle(z13, "$x_5$", "$\epsilon_5$", "l"); CircleToRectangle(z13,z1, "$\lambda_5$");
%% formatywny
z2 = (80ux,20ux); ErCircle(z2, "$\eta_2$", "$\delta_2$", "r");
mc := x2 + fff;
loading_pos := .5 ;
z25 = (mc -8ux,0ux); Rectangle(z25, "$x_6$"); RectangleToCircle(z25,z2, "$\lambda_6$");
z20 = (mc,10ux); Rectangle(z20, "$x_7$"); RectangleToCircle(z20,z2, "$\lambda_7$");
z21 = (mc,20ux); Rectangle(z21, "$x_8$"); RectangleToCircle(z21,z2, "$\lambda_8$");
z22 = (mc,30ux); Rectangle(z22, "$x_9$"); RectangleToCircle(z22,z2, "$\lambda_9$");
z23 = (mc -8ux,40ux); Rectangle(z23, "$x_{10}$"); RectangleToCircle(z23,z2, "$\lambda_{10}$");
%% Mimic:
z3 = (60ux,20ux); ErCircle(z3, "$\eta_3$", "$\delta_3$", "r");
z35 = (x3 -12ux,38ux); Rectangle(z35, "$y_1$"); RectangleToCircle(z3,z35, "$\lambda_1$");
z30 = (x3 +12ux,38ux); Rectangle(z30, "$y_2$"); RectangleToCircle(z3,z30, "$\lambda_2$");
z36 = (x3 -14ux,8ux); Rectangle(z36, "$x_1$"); RectangleToCircle(z36,z3, "$\gamma_1$");
z37 = (x3 + 0ux,8ux); Rectangle(z37, "$x_2$"); RectangleToCircle(z37,z3, "$\gamma_2$");
z38 = (x3 +14ux,8ux); Rectangle(z38, "$x_3$"); RectangleToCircle(z38,z3, "$\gamma_3$");
CurrRectangleToRectangle(z36,z37, -140, "b");
CurrRectangleToRectangle(z37,z38, -140, "b");
CurrRectangleToRectangle(z36,z38, -140, "b");
corr_d_err :=1.5ux;
endfig;
beginfig(2)%% eucs5f.mps
label.rt(btex \bf b) etex, (0ux,40ux) );
fof:=25ux; sof:=55ux; zof:=9ux;
%% czynnik #1
z1 = (0zl,fof); Circle(z1, "$\eta_1$"); xx := x1 - rwd;
z15 = (xx,zof); ErRectangle(z15, "$x_1$", "$\epsilon_1$", "b"); CircleToRectangle(z15,z1, "");
z16 = (xx+zz,zof); ErRectangle(z16, "$x_2$", "$\epsilon_2$", "b"); CircleToRectangle(z16,z1, "");
%% czynnik #2
z2 = (zl,fof); Circle(z2, "$\eta_2$"); xx := x2 - rwd;
z25 = (xx,zof); ErRectangle(z25, "$x_3$", "$\epsilon_3$", "b"); CircleToRectangle(z25,z2, "");
z26 = (xx+zz,zof); ErRectangle(z26, "$x_4$", "$\epsilon_4$", "b"); CircleToRectangle(z26,z2, "");
%% czynnik #3
z3 = (2zl,fof); Circle(z3, "$\eta_3$"); xx := x3 - rwd;
z35 = (xx,zof); ErRectangle(z35, "$x_5$", "$\epsilon_5$", "b"); CircleToRectangle(z35,z3, "");
z36 = (xx+zz,zof); ErRectangle(z36, "$x_6$", "$\epsilon_6$", "b"); CircleToRectangle(z36,z3, "");
%% czynnik #4
z4 = (3zl,fof); Circle(z4, "$\eta_4$"); xx := x4 - rwd;
z45 = (xx,zof); ErRectangle(z45, "$x_7$", "$\epsilon_7$", "b"); CircleToRectangle(z45,z4, "");
z46 = (xx+zz,zof); ErRectangle(z46, "$x_8$", "$\epsilon_8$", "b"); CircleToRectangle(z46,z4, "");
%% czynnik #5
z5 = (4zl,fof); Circle(z5, "$\eta_5$"); xx := x5 - rwd;
z55 = (xx,zof); ErRectangle(z55, "$x_9$", "$\epsilon_9$", "b"); CircleToRectangle(z55,z5, "");
z56 = (xx+zz,zof); ErRectangle(z56, "$x_{10}$", "$\epsilon_{10}$", "b"); CircleToRectangle(z56,z5, "");
z57 = (xx+2zz,zof + 4ux); ErRectangle(z57, "$x_{11}$", "$\epsilon_{11}$", "r"); CircleToRectangle(z57,z5, "");
z58 = (xx+2zz,zof + 15ux); ErRectangle(z58, "$x_{12}$", "$\epsilon_{12}$", "r");
CircleToRectangle(z58,z5, "");
CurrCircleToCircle(z1,z2, 120, "");
CurrCircleToCircle(z1,z3, 130, "");
CurrCircleToCircle(z1,z4, 140, "");
CurrCircleToCircle(z1,z5, 150, "");
CurrCircleToCircle(z2,z3, 130, "");
CurrCircleToCircle(z2,z4, 140, "");
CurrCircleToCircle(z2,z5, 140, "");
CurrCircleToCircle(z3,z4, 130, "");
CurrCircleToCircle(z3,z5, 140, "");
CurrCircleToCircle(z4,z5, 140, "");
endfig;
beginfig(1)%% eucs1f.mps
label.rt(btex \bf a) etex, (10ux,40ux) );
fof:=25ux; sof:=35ux; zof:=9ux;
%% czynnik #1
z1 = (10ux,fof); xx := x1 - rwd;
z9 = (60ux,sof); Circle(z9, "$\eta$");
z15 = (xx +4ux,zof +8ux); ErRectangle(z15, "$x_1$", "$\epsilon_1$", "b"); CircleToRectangle(z15,z9, "");
z16 = (xx+zz,zof); ErRectangle(z16, "$x_2$", "$\epsilon_2$", "b"); CircleToRectangle(z16,z9, "");
z25 = (xx+2zz,zof); ErRectangle(z25, "$x_3$", "$\epsilon_3$", "b"); CircleToRectangle(z25,z9, "");
z26 = (xx+3zz,zof); ErRectangle(z26, "$x_4$", "$\epsilon_4$", "b"); CircleToRectangle(z26,z9, "");
z35 = (xx+4zz,zof); ErRectangle(z35, "$x_5$", "$\epsilon_5$", "b"); CircleToRectangle(z35,z9, "");
z36 = (xx+5zz,zof); ErRectangle(z36, "$x_6$", "$\epsilon_6$", "b"); CircleToRectangle(z36,z9, "");
z45 = (xx+6zz,zof); ErRectangle(z45, "$x_7$", "$\epsilon_7$", "b"); CircleToRectangle(z45,z9, "");
z46 = (xx+7zz,zof); ErRectangle(z46, "$x_8$", "$\epsilon_8$", "b"); CircleToRectangle(z46,z9, "");
z55 = (xx+8zz,zof); ErRectangle(z55, "$x_9$", "$\epsilon_9$", "b"); CircleToRectangle(z55,z9, "");
z56 = (xx+9zz,zof); ErRectangle(z56, "$x_{10}$", "$\epsilon_{10}$", "b"); CircleToRectangle(z56,z9, "");
z57 = (xx+10zz,zof +3ux); ErRectangle(z57, "$x_{11}$", "$\epsilon_{11}$", "b"); CircleToRectangle(z57,z9, "");
z58 = (xx+11zz -4ux,zof +15ux); ErRectangle(z58, "$x_{12}$", "$\epsilon_{12}$", "b");
CircleToRectangle(z58,z9, "");
endfig;
%% Model pięcioczynnikowy z czynnikiem drugiego stopnia
beginfig(3) %% eucs5f1f.mps
fof:=25ux; sof:=45ux; zof:=9ux;
%% czynnik #1
z1 = (0zl,fof); Circle(z1, "$\eta_1$"); ErCircle(z1, "$\eta_1$", "$\delta_1$", "r");
xx := x1 - rwd;
z15 = (xx,zof); ErRectangle(z15, "$x_1$", "$\epsilon_1$", "b"); CircleToRectangle(z15,z1, "");
z16 = (xx+zz,zof); ErRectangle(z16, "$x_2$", "$\epsilon_2$", "b"); CircleToRectangle(z16,z1, "");
%% czynnik #2
z2 = (1zl,fof); Circle(z2, "$\eta_2$"); ErCircle(z2, "$\eta_2$", "$\delta_2$", "r");
xx := x2 - rwd;
z25 = (xx,zof); ErRectangle(z25, "$x_3$", "$\epsilon_3$", "b"); CircleToRectangle(z25,z2, "");
z26 = (xx+zz,zof); ErRectangle(z26, "$x_4$", "$\epsilon_4$", "b"); CircleToRectangle(z26,z2, "");
%% czynnik #3
z3 = (2zl,fof); Circle(z3, "$\eta_3$"); ErCircle(z3, "$\eta_3$", "$\delta_3$", "r");
xx := x3 - rwd;
z35 = (xx,zof); ErRectangle(z35, "$x_5$", "$\epsilon_5$", "b"); CircleToRectangle(z35,z3, "");
z36 = (xx+zz,zof); ErRectangle(z36, "$x_6$", "$\epsilon_6$", "b"); CircleToRectangle(z36,z3, "");
%% czynnik #4
z4 = (3zl,fof); ErCircle(z4, "$\eta_4$", "$\delta_4$", "r");
xx := x4 - rwd;
z45 = (xx,zof); ErRectangle(z45, "$x_7$", "$\epsilon_7$", "b"); CircleToRectangle(z45,z4, "");
z46 = (xx+zz,zof); ErRectangle(z46, "$x_8$", "$\epsilon_8$", "b"); CircleToRectangle(z46,z4, "");
%% czynnik #5
z5 = (4zl,fof); ErCircle(z5, "$\eta_5$", "$\delta_5$", "r");
xx := x5 - rwd;
z55 = (xx,zof); ErRectangle(z55, "$x_9$", "$\epsilon_9$", "b"); CircleToRectangle(z55,z5, "");
z56 = (xx+zz,zof); ErRectangle(z56, "$x_{10}$", "$\epsilon_{10}$", "b"); CircleToRectangle(z56,z5, "");
z57 = (xx+2zz,zof + 4ux); ErRectangle(z57, "$x_{11}$", "$\epsilon_{11}$", "r"); CircleToRectangle(z57,z5, "");
z58 = (xx+2zz,zof + 15ux); ErRectangle(z58, "$x_{12}$", "$\epsilon_{12}$", "r");
CircleToRectangle(z58,z5, "");
z9 = (60ux,sof); Circle(z9, "$\eta_6$");
CircleToCircle(z1,z9, "", "");
CircleToCircle(z2,z9, "", "");
CircleToCircle(z3,z9, "", "");
CircleToCircle(z4,z9, "", "");
CircleToCircle(z5,z9, "", "");
endfig;
beginfig(8)%% ctcm.mps
fof:=25ux; sof:=55ux; zof:=9ux;
%% czynnik #1 (metoda 1)
z1 = (35ux,fof); Circle(z1, "$M_1$"); xx := 22ux - 4 rwd;
z15 = (xx,zof); ErRectangle(z15, "$x_1$", "$\epsilon_1$", "b"); CircleToRectangle(z15,z1, "");
z16 = (xx+zz,zof); ErRectangle(z16, "$x_2$", "$\epsilon_2$", "b"); CircleToRectangle(z16,z1, "");
z17 = (xx+2zz,zof); ErRectangle(z17, "$x_3$", "$\epsilon_3$", "b"); CircleToRectangle(z17,z1, "");
z18 = (xx+3zz,zof); ErRectangle(z18, "$x_4$", "$\epsilon_4$", "b"); CircleToRectangle(z18,z1, "");
z19 = (xx+4zz,zof); ErRectangle(z19, "$x_5$", "$\epsilon_5$", "b"); CircleToRectangle(z19,z1, "");
%% czynnik #2 (metoda 2)
z2 = (68ux,fof); Circle(z2, "$M_2$"); xx := 75ux - 3rwd;
z25 = (xx,zof); ErRectangle(z25, "$x_6$", "$\epsilon_3$", "b"); CircleToRectangle(z25,z2, "");
z26 = (xx+zz,zof); ErRectangle(z26, "$x_7$", "$\epsilon_2$", "b"); CircleToRectangle(z26,z2, "");
z27 = (xx+2zz,zof); ErRectangle(z27, "$x_8$", "$\epsilon_3$", "b"); CircleToRectangle(z27,z2, "");
z28 = (xx+3zz,zof); ErRectangle(z28, "$x_9$", "$\epsilon_4$", "b"); CircleToRectangle(z28,z2, "");
CurrCircleToCircle(z1,z2, 140, "");
%% czynniki cech:
fog:= -12ux;
z3 = (1.0zl,fog); Circle(z3, "$C_1$");
CircleToRectangle(z15,z3, "");
CircleToRectangle(z18,z3, "");
CircleToRectangle(z26,z3, "");
z4 = (2.3zl,fog); Circle(z4, "$C_2$");
CircleToRectangle(z16,z4, "");
CircleToRectangle(z19,z4, "");
CircleToRectangle(z27,z4, "");
z5 = (3.5zl,fog); Circle(z5, "$C_3$");
CircleToRectangle(z17,z5, "");
CircleToRectangle(z25,z5, "");
CircleToRectangle(z28,z5, "");
CurrCircleToCircle(z3,z4, -140, "");
CurrCircleToCircle(z4,z5, -140, "");
CurrCircleToCircle(z3,z5, -140, "");
endfig;
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%
end.
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%
beginfig(99)
%% czynnik #1
z1 = (40ux,20ux); ErCircle(z1, "$\eta_1$", "$\delta_1$", "r");
%% miary (refleksyjne):
z15 = (10ux,0ux); ErRectangle(z15, "$x_1$", "$\epsilon_1$", "l"); CircleToRectangle(z15,z1, "$\lambda_1$");
z10 = (10ux,10ux); ErRectangle(z10, "$x_2$", "$\epsilon_2$", "l"); CircleToRectangle(z10,z1, "$\lambda_2$");
z11 = (10ux,20ux); ErRectangle(z11, "$x_3$", "$\epsilon_3$", "l"); CircleToRectangle(z11,z1, "$\lambda_3$");
z12 = (10ux,30ux); ErRectangle(z12, "$x_4$", "$\epsilon_4$", "l"); CircleToRectangle(z12,z1, "$\lambda_4$");
z13 = (10ux,40ux); ErRectangle(z13, "$x_5$", "$\epsilon_5$", "l"); CircleToRectangle(z13,z1, "$\lambda_5$");
%% czynnik #2
z2 = (90ux,20ux); ErCircle(z2, "$\eta_2$", "$\delta_2$", "r");
%% miary (refleksyjne):
z25 = (120ux,0ux); ErRectangle(z25, "$x_6$", "$\epsilon_6$", "r"); CircleToRectangle(z25,z2, "");
z20 = (120ux,10ux); ErRectangle(z20, "2", "$\epsilon_7$", "r"); CircleToRectangle(z20,z2, "");
z21 = (120ux,20ux); ErRectangle(z21, "3", "$\epsilon_8$", "r"); CircleToRectangle(z21,z2, "");
z22 = (120ux,30ux); ErRectangle(z22, "4", "$\epsilon_9$", "r"); CircleToRectangle(z22,z2, "");
z23 = (120ux,40ux); ErRectangle(z23, "5", "$\epsilon_{10}$", "r"); CircleToRectangle(z23,z2, "");
%% czynnik #3 (mierzony formatywnie)
z3 = (65ux,0ux); ErCircle(z3, "$\eta_3$", "$\delta_3$", "r");
%% miary (formatywne):
z35 = (45ux,-15ux); ErRectangle(z35, "$x_{11}$", "$\epsilon_{11}$", "b"); RectangleToCircle(z35,z3, "");
z36 = (65ux,-15ux); Rectangle(z36, "$x_{12}$"); RectangleToCircle(z36,z3, "");
z37 = (85ux,-15ux); Rectangle(z37, "$x_{13}$"); RectangleToCircle(z37,z3, "");
%% x_13 i x_12 korelują swobodnie:
CurrRectangleToRectangle(z36, z37, -130, "b");
CircleToCircle(z3,z1, "NUL", "$\gamma_1$");
CircleToCircle(z3,z2, "", "$\gamma_2$");
%% czynnik 1 i 2 korelują swobodnie:
CurrCircleToCircle(z1,z2, 140, "");
label.rt(btex \bf Strukturalny model trzyczynnikowy etex, (30ux,42ux) );
endfig;
bye
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.