7-18

$${W_g = mgd \cos (\theta + 90^{\circ}) = -mgd \sin \theta}$$