First of all, sorry for my extremely low knowledge about mathematics. All i am able to do is this image which describe the problem.
Image of triangle + information
I want to know that how can i calculate the X distance each time while Z object is moving continuously from top to bottom.
Note: This is not an assignment.
Note that $$AB^2+BC^2=(18-6)^2+(16-10)^2=AC^2$$
So $\triangle ABC$ is a right-angled triangle.
Let the smaller triangle be $\triangle ADE$. It is obvious that $\triangle ADE\sim \triangle ABC$($\because AAA$).
Similar triangles have the same ratio for every pairs of sides. In this problem,
$$\frac{DE}{BC}=\frac{AZ}{AB}$$
Let $Z=(10,a)$, $6\le a\le 18$. We have
$$\frac{x}{6}=\frac{a-6}{12}$$
$$x=\frac{a-6}2$$