Calculate Angle
The calculate angle module provides a way to easily calculate the angle between two lines defined by three points. The three points are assumed to already
be accessible as RoboRealm variables. The result will be placed into the result variable.
Be wary of the resulting range as the angle is calculated relative to the ordering of the points that define the lines. Due to this
the resulting angle might "take the long way around". For example, an angle at 120 degrees counterclockwise is also -240 degrees clockwise.
See the examples below that illustrate more of this point.
Interface
Instructions
1. 3 Points Triangle - specify the points that make up a corner. The angle measured
will be the smaller angle created by the three points.
2. 2 Points Line - specify two points that make up a line. The angle measure will
be the angle of this line with horizontal right being 0 deg and up being 90 deg, etc. Note
that due to line symmetry 180 and 0 are the same, likewise 270 and 90, etc.
3. 4 Points 2 Lines - specify four points that describe two lines that intersect. The
angle will then be the smaller angle formed by the intersection of these two lines.
The larger angle would then be (360 - (2*angle))/2.
4. Result - specify the resulting variable that should hold the calculated angle, whether that measurement should be provided in
radians or degrees and what range that measurement should have. Note that if you specify 0 ->180 then only acute angles are
provided by disregarding the ordering of the points. If you wish to measure the angle taking in consideration the ordering of the
specified points select a range that extends the result such as -360 to 360.
Example
Click here to load a robofile that you can use to alter the resulting
angle by clicking in the main RoboRealm interface.
The following shows the output of the example file using a right triangle. Note that only the result range is changed
in each image to show the different interpretations that occur when measuring an angle.
 | Range is 0 -> 180 |
 | Range is 0 -> 360 |
 | Range is -180 -> 180 |
 | Range is 0 -> 180 |
 | Range is -360 -> 360 |
See Also
Calculate Distance
|