D:\j_Iam_TEMP\_jh\jh_Golden_Rule_Mechanics_v1.wxmx

The golden rule of mechanics. Ratio of forces equal to the inverse ratio of distances

kill(all);

G1:3;G2:1;G:G1+G2;

hx1:1;hy1:2;hx2:10;hy2:2;

mG1x:G1*hx1;mG2x:G2*hx2;mGx:mG1x+mG2x;

h_x:(mGx)/G,numer;

sw:hx2+4;sh:hy2+8;del:0.5; hy_lever:hy2+4;

del1:1;del05:del1/2;

Formating string for draw

 sW:[G1,G2,G,hx1,hx2,h_x];sS:['G1,'G2,'G,'x1,'x2,'x,'L];sU:['N,'N,'N,'m,'m,'m,"?"]; 

 fstr3(sW,sS,sU):=block([l,eqq,w,u,my_string],
   l:sconcat(sS),
   eqq:sconcat("="),
   w:string(sW),
   u:concat(sU),
  my_string:concat(l,eqq,w,u),
return (my_string)); 

 text_string:fstr3(sW[1],sS[1],sU[1]); 

 fstr_sum(sW,sS,sU,G1,G2):=block([name,eqq,plus,w,u,g1,g2,my_string],
   name:sconcat(sS),
   eqq:sconcat("="),
   plus:sconcat("+"),
   w:string(sW),
   u:concat(sU),
   g1:G1,
   g2:G2,
  my_string:concat(name,eqq,g1,u,plus,g2,u,eqq,w,u),
return (my_string)); 

 fstr_sum(sW[3],sS[3],sU[3],G1,G2); 

# VARIANTS coordinates '0x'  

draw2d(xrange = [0,sw],
yrange = [0,sh],
   font      = "Arial",
            font_size = 30,
title="Golden_Rule_Mechanics.wxmx  Var 1 ",
   grid = true,
   proportional_axes=xy,
line_width=1,color=black,
    fill_density=0.2,
        fill_color = "#0e406e",
rectangle([h_x-sqrt(G)/2,hy2-sqrt(G)/2],[h_x+sqrt(G)/2,hy2+sqrt(G)/2]),
    fill_density=1,
    fill_color = "#eeeeee",
rectangle([hx1-sqrt(G1)/2,hy1-sqrt(G1)/2],[hx1+sqrt(G1)/2,hy1+sqrt(G1)/2]),
rectangle([hx2-sqrt(G2)/2,hy2-sqrt(G2)/2],[hx2+sqrt(G2)/2,hy2+sqrt(G2)/2]),
    points_joined = false,
    color=red,point_type = filled_circle,point_size = 1.5,
  points([[hx1,hy1],[hx2,hy2],[h_x,hy2],[0,hy_lever],[hx1,hy_lever],[h_x,hy_lever],[hx2,hy_lever]]), 
    color=black,
    points_joined = true,
    point_size=0.6,
    line_width=1.3,
    line_type = solid,
    points([[hx1,hy1],[hx1,hy_lever]]),
    points([[hx2,hy2],[hx2,hy_lever]]),
    points([[h_x,hy2],[h_x,hy_lever]]),
    points([[0,hy_lever],[hx2,hy_lever]]),
    label([fstr3(sW[1],sS[1],sU[1]),hx1,hy1-del05]),
    label([fstr3(sW[2],sS[2],sU[2]),hx2,hy2-del05]),
    label([fstr_sum(sW[3],sS[3],sU[3],G1,G2),h_x,hy2-(del1+del05)]),
    points_joined = true,
    color="#0e406e",
     line_width=1,
    point_size=0.1,
    line_type=dashes,
    points([hx1,hx1],[0,hy1]),
     points([hx2,hx2],[0,hy2]),
      points([h_x,h_x],[0,hy2]),
    line_type=solid,
    head_length = 0.3,
head_angle = 10,
    head_both = true,
    line_width=0.5,
vector([0,hy_lever-del1],[hx1,0]),
     label([fstr3(sW[4],sS[4],sU[4]),hx1/2,hy_lever-del1+del05/2]),
    vector([0,hy_lever-2*del1],[hx2,0]),
     label([fstr3(sW[5],sS[5],sU[5]),hx2/2,hy_lever-2*del1+del05/2]),
    color = red,
    vector([0,hy_lever-3*del1],[h_x,0]),
    label(["0",0,hy_lever+del05]),
    label([fstr3(sW[6],sS[6],sU[6]),h_x/2,hy_lever-3*del1+del05/2]),
    color = black,
    label(["G1:4;G2:1;G:G1+G2;",sw/2,(sh-del)]),
    label(["hx1:1;hy1:1;hx2:2.5;hy2:0.5;",sw/2,(sh-del*2)]),
    label(["mG1x:G1*hx1;mG2x:G2*hx2;mGx:mG1x+mG2x;",sw/2,(sh-del*3)]),
    label(["h_x:(mGx)/G;",sw/2,(sh-del*4)]),
    label(["mG1y:G1*hy1;mG2y:G2*hy2;mGy:mG1y+mG2y;",sw/2,(sh-del*5)]),
    label(["h_y:(mGy)/G;",sw/2,(sh-del*6)]),
/*     points_joined = true,
    color=black,point_type = filled_circle,point_size = 1.5,
points([1,1.3,2.5],[1,0.9,0.5]),
    color=red,points_joined = false,
    points([0,1.3],[0,0.9]),
   color="#0e406e",
    points([1.3],[0.9]),  
    label(["(1.3,0.9)",0.9,0.7]),
        points_joined = true,
    points([0,1.3],[0.9,0.9]),
    points([1.3,1.3],[0,0.9]), */
/*    color="#0e406e",
     line_width=1,
    point_size=1.4,
    line_type=dashes,
    points([0,2.5],[0.5,0.5]),
    points([2.5,2.5],[0,0.5]),
    points([1,1],[0,1]),
    points([0,1],[1,1]),  */
       /*  GPL */
font      = "Arial",
            font_size = 16,
   color = "#0e406e",
label_orientation = 'vertical,
label(["www.k123.org.ua ",sw-del05,sh/2]),
   label(["Kopanytsia Y (c)  2025",sw-2*del05,sh/2])
    )$

# VARIANTS NUMBER 2 (-)

G1:6;G2:1;hx1:1.5;hx2:2.5;G:G1-G2;hy1:1;hy2:1.5;

h_x_:(G1*hx1-G2*hx2)/G;

h_y:(G1*hy1-G2*hy2)/G;

draw2d(xrange = [0,4.5],
yrange = [0,3.5],
   font      = "Arial",
            font_size = 30,
title="jh_Center_weight.wxmx  Var 2 -",
   grid = true,
   proportional_axes=xy,
line_width=4,color=black,
    fill_color = "#eeeeee",
rectangle([0,0],[3,2]),
    fill_color = "#fefefe",
    rectangle([2,1],[3,2]),
    points_joined = true,
    point_size=0.1,
    line_width=1.3,
    line_type = solid,
  points([[0,1],[3,1]]), 
    points([[1,0],[1,2]]),
    points([[2,0],[2,2]]),
    label(["G1=+6",1.5,1.7]),
    label(["G2=-1",2.5,1.7]),
    color = black,
    label(["G1:6;G2:1;hx1:1.5;hx2:2.5;",2.5,3.3]),
    label(["G:G1-G2;hy1:1;hy2:1.5;",2.5,3]),
    label(["h_x_:(G1*hx1-G2*hx2)/G;",2.5,2.7]),
    label(["h_y:(G1*hy1-G2*hy2)/G;;",2.5,2.4]),
    points_joined = true,
    color=black,point_type = filled_circle,point_size = 1.5,
points([1.5,1.3,2.5],[1,0.9,1.5]),
    color=red,points_joined = false,
    points([0,1.3],[0,0.9]),
    color="#0e406e",
    points([1.3],[0.9]),
    label(["(1.3,0.9)",0.9,0.7]),
    points_joined = true,
    points([0,1.3],[0.9,0.9]),
    points([1.3,1.3],[0,0.9]),
    color=red,
     line_width=1,
    point_size=1.4,
    line_type=dashes,
    points([0,2.5],[1.5,1.5]),
    points([2.5,2.5],[0,1.5]),
    points([1.5,1.5],[0,1]),
     points([0,1.5],[1,1]),
  /*  GPL */
font      = "Arial",
            font_size = 16,
   color = "#0e406e",
label_orientation = 'vertical,
label(["www.k123.org.ua ",4,1.3]),
   label(["Kopanytsia Y (c)  2025",4.3,1.3])
    )$;

D:\j_Iam_TEMP\_jh\jh_Center_weight_2.svg