# Centroid based on Y coordinates

#### kris8888

Hi Everyone,

I'm trying to calculate centroid of box in attached picture. But the results are always a bit off, and I can't figure out what I'm doing wrong

I know these info:

Y coordinate of A (0)
XY coordinate on line d called E (0 , 3.33)
Y coordinate on line d called F (6.66)
The space between E and F on x-axis (5).
lenght of a (7.07)
lenght of d (18.03)

See attached image for concrete example

$$\displaystyle M = \dfrac{6.66 - 3.33}{5} = \dfrac{333}{500}$$

E = Centroid
$$\displaystyle |AE| = \sqrt{(0.5 * 7.07)^2 + (0.5 * 18.03)^2} = \dfrac{\sqrt{3750658}}{200}$$

θ = angle between line AD and X-axis
$$\displaystyle \tan(\theta) = \tan(M) = \tan(\dfrac{333}{500}) = 33.6636$$

ϕ = the angle between line AD and diagonal AC
$$\displaystyle \tan(\phi) = \tan(a/b) = \tan(7.07/18.03) = 21.4113$$

$$\displaystyle \tan(\theta + \phi) = \tan(33.6636 + 21.4113) = 55.0349$$

$$\displaystyle x coordinate A = \dfrac{0 - 3.33}{\dfrac{333}{500}} = -5$$

$$\displaystyle Centroid_x = x coordinate A + AE * \cos(\theta + \phi) = -5 + \dfrac{\sqrt{3750658}}{200} * \cos(55.0349) = 0.549285$$

$$\displaystyle Centroid_y = y coordinate A + AE * \sin(\theta + \phi) = 0 + \dfrac{\sqrt{3750658}}{200}* \sin(55.0349) = 7.93$$

This should have been (0 , 7.5) - what am I doing wrong ... any help would be greatly appreciated Last edited:

#### kris8888

SOLVED

Can you delete a post