omdl
v0.6.1
OpenSCAD Mechanical Design Library
|
Angle units and conversions. More...
Files | |
file | units_angle.scad |
Angle units and conversions. | |
Functions | |
function | unit_angle_name (u=base_unit_angle) |
Return the name of an angle unit identifier. More... | |
function | convert_angle (a, from=base_unit_angle, to=base_unit_angle) |
Convert an angle from some units to another. More... | |
Variables | |
base_unit_angle = "d" | |
<string> The base units 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 units.
units id | description | type |
---|---|---|
r | radian | decimal |
d | degree | decimal |
dms | degree, minute, second | decimal-list-3 |
Example
Result (base_angle_length = r):
Result (base_angle_length = d):
Result (base_angle_length = dms):
function convert_angle | ( | a | , |
from | = base_unit_angle , |
||
to | = base_unit_angle |
||
) |
Convert an angle from some units to another.
a | <decimal|decimal-list-3> An angle to convert. |
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 | ( | u | = base_unit_angle | ) |
Return the name of an angle unit identifier.
u | <string> An angle unit identifier. |