*Hello everyone, I need your help, I'm looking for the center of the figure in green in terms of a point with these coordinates (X, Y) that I posted on the following link: https://i.stack.imgur.com/7jPqM.jpg I tried to apply Guldin's method? ? , look for the center of gravity, the moment of inertia but in vain. could you help me and provide me the code in scilab, because I've been looking for the solution in terms of code and mathematical analysis for a long time. you will find attached the scilab code. enter code here
function y = h(x)
if x < 50 | 210 < x then
error("Out of range");
elseif x <= 90 then
y= -57.376067 +9.3746343*x -0.2175008*x^2 +0.0013792*x^3
//disp('50-90')
return;
elseif x <=100 then
y= 10330.932 -336.90229*x +3.6300206*x^2 -0.0128709*x^3;
//disp('90-100')
elseif x <= 130 then
y=-6387.7416 +164.65791*x -1.3855814*x^2 +0.0038478*x^3;
//disp('100-130')
return;
else
y = 5028.1996 -98.786888*x +0.640917*x^2 -0.0013484*x^3;
//disp('130-210')
end
endfunction
t=[50:210];
plot(t,feval(t,h),'r*')
l=[50 60 90 100 130 150 210]
k=[40 20 30 70 55 80 60]
plot(l,k,'d')
for i=[40 20 30 70 55 80 60]
teta=[0: 220]
beta=linspace(100,100,221)
plot(teta,beta,'*')
teta1=[100:160:221]
beta1=linspace(100,160-2*rand(),221)
plot2d3(teta1,beta1)
end
a=gca()
a.sub_ticks = [5,5]
a.grid_thickness = [0.05,0.05];
a.grid = [-1,-1]
a.grid_position = "foreground"
//a.grid_thickness = [0.05,0.05]
xgrid(0)
C=[50 60 90 100 130 150 210]
//for j=1:size(C,'c')
//C(j)
//if c(k)<=50 then
// (m=k+1& c(m))
J=numderivative(h,t) /*jacobien*/
//f=C(j)
// J=numderivative(h,i) /*jacobien*/
deff('[z] = h2(k)', 'z = h(k)-100');
// disp(C(j))
//for i=[157.56011:204.1084]
[x,fx,v]=fsolve([150,200],h2)
disp(x)
disp(fx)
plot(x,fx+100,)
disp(v)
//plot(x,h2,'d')
//end
//po=[50 60 90 100 130 150 210]
//co=[40 20 30 70 55 80 60]
lh=linspace(157.56011,204.1084);
lpo=feval(lh,h);
xfpoly(lh,lpo)
e=gce()
e.background=13