summaryrefslogtreecommitdiff
path: root/3137/CH10/EX10.5/Ex10_5.sce
blob: 70c0fb6feef64680e9269c3b72c3d7f21e96ed81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//Initilization of variables
r=50 //mm
L1=75 //mm
L2=%pi*r //mm
L3=61.2 //mm
theta1=45 //degrees
theta2=60 //degrees
//Calculations
x_bar=[(L1/2)*cosd(theta1),L1*cosd(theta1)+r,L1*cosd(theta1)+100+(L3/2)*cosd(theta2)] //mm
y_bar=[(L1/2)*sind(theta1),L1*sind(theta1)+(2*r)/%pi,(L3/2)*sind(theta2)] //mm
//Centroid Calculations
x=(L1*x_bar(1)+L2*x_bar(2)+L3*x_bar(3))/(L1+L2+L3) //mm
y=(L1*y_bar(1)+L2*y_bar(2)+L3*y_bar(3))/(L1+L2+L3) //mm
//Result
clc
printf('The centroid is as follows x=%f mm and y=%fmm',x,y)