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. Points - specify the points that make up a corner. If only the start and middle points are provided the module will consider the last
point as lying on the X Axis of the middle point. In this manner a line segment's angle can be measured from 0 degrees.
2. 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
| Calculate_Angle Related Forum Posts | Last post | Posts | Views |
Define angle with small soccer plates
Hi,
can we find the angle between colors used on plates in small soccer leagues?
thanks... |
4 months |
6 |
355 |
|