Back to: Multiplier Event Luxembourg

For reference, a little XYZ coordinate system is printed on the Circuit Playground Express screen next to the accelerometer chip. The figure on the left shows a representation of the coordinate system displayed on the Circuit Playground Express screen. The Z-axis points out of the screen.
The Circuit Playground Express board is held at eye level with a slight tilt angle \(\alpha\), as shown in the coordinate system below, which is integrated into the real-life situation.

- \(\vec{a}\begin{pmatrix}a_x\\a_y\\a_z\end{pmatrix}\) represents the total acceleration,
- \(\vec{x}\begin{pmatrix}a_x\\0\\0\end{pmatrix}\) represents the acceleration detected in the direction of X,
- \(\vec{y}\begin{pmatrix}0\\a_y\\0\end{pmatrix}\) represents the acceleration detected in the direction of Y, and
- \(\alpha\) represents the angle of rotation of the Circuit Playground Express board around its centre. The X-axis of the Circuit Playground Express board is situated on the imaginary ray going from the eye to the top of the tree.
Some right-angle math and a basic trigonometric function formula allow one to determine the approximate height of an object, such as a tree.
\(\tan(\alpha)=\frac{\text{opposite side of }\alpha}{\text{adjacent side of }\alpha}\)

\(\begin{align}\tan(\alpha)&=\frac{a_x}{a_y}\qquad\qquad(1)\\\Leftrightarrow\qquad\alpha&=\arctan\left(\frac{a_x}{a_y}\right)\end{align}\)

\(\begin{alignat}{3}& &&tan(\alpha)~&&&=\frac{(h-e)}{d}\\&\Leftrightarrow~&&d\cdot\tan(\alpha)~&&&=h-e\\&\Leftrightarrow~&&h-e~&&&=d\cdot\tan(\alpha)\quad\lvert~\text{substitute }(1)\\&\Leftrightarrow~&&h-e~&&&=d\cdot\frac{a_x}{a_y}\\&\Leftrightarrow~&&h~&&&=d\cdot\frac{a_x}{a_y}+e\end{alignat}\)
In order to calculate the height of an object, the distance (\(d\)) between the person and the object, as well as their eye level (\(e\)) must be known. The angle value (\(\alpha\)) will be determined using the Circuit Playground Express as an inclinometer and displayed through a sequence of lighted-unlighted NeoPixels.