Next the shoulder and elbow angles must be computed. These are computed from the perspective looking at the forearm plane along the shoulder axis. This is illustrated in Figure 4.

: Idealized Robot Arm Viewed From the Side
In this figure, the length of the RoboArm ``upper'' arm is
and
the length of the forearm is
.
Consider two circles, one of radius
around the origin and
one of radius
around the point
.
The equations for these two circles are

Solving
for u

and multiplying out

Now substituting for u in
gives an equation
only in v.
Choosing the positive square root in substituting for u
identifies the point on
of height v in the
right half of the plane and the negative choice in the left half
of the plane.
While the actual solution could be either, the value of v will
be the same regardless.
This substitution gives

A little algebra yields

where
,
which can be solved by the quadratic formula.
The positive square root is always chosen in solving the quadratic
formula for v,
because choosing the lower height may lead to a negative height for
the elbow (this does not make sense physically) and because there is more
downward movement than upward on the elbow.
Now that the vertical position of the elbow is established,
the angles at which the shoulder and
elbow need to be set can be found.
Using the same reasoning as for
in the previous subsection,

Note that u may be positive or negative, which would be consistent
with
being positive or negative.
One of the easiest ways to decide which
is to determine if the distance between
and
is equal to
with u positive.
If it is then u must be positive, if not it must be negative and so
must
.
The angle between the forearm and the horizontal is given by

But on the RoboArm, the elbow angle is specified with respect to a plane
perpendicular to the upper arm.
So adjusting
to get the actual elbow angle
