omdl
v0.5
OpenSCAD Mechanical Design Library
|
Angle units and conversions. More...
Files | |
file | units_angle.scad |
Angle units and conversions. | |
Functions | |
function | unit_angle_name (units=base_unit_angle) |
Return the name of the given angle unit identifier. More... | |
function | convert_angle (angle, from=base_unit_angle, to=base_unit_angle) |
Convert the angle from from units to to units. More... | |
Variables | |
base_unit_angle = "d" | |
<string> Base unit for angle measurements. | |
Angle units and conversions.
These functions allow for angles to be specified with units. Angles specified with units are independent of (base_unit_angle). There are also unit conversion functions for converting from one unit to another.
The table below enumerates the supported unit identifiers and their descriptions.
units id | description |
---|---|
r | radian |
d | degree |
dms | degree, minute, second |
Example
Result (base_angle_length = r):
Result (base_angle_length = d):
Result (base_angle_length = dms):
function convert_angle | ( | angle | , |
from | = base_unit_angle , |
||
to | = base_unit_angle |
||
) |
Convert the angle
from from
units to to
units.
angle | <decimal|vector> An angle to convert (dms angles are 3-tuple vector [d, m, s]). |
from | <string> The units of the angle to be converted. |
to | <string> A units to which the angle should be converted. |
function unit_angle_name | ( | units | = base_unit_angle | ) |
Return the name of the given angle unit
identifier.
units | <string> An angle unit identifier. |