121 function length_unit_name_1d
124 ) = u ==
"pm" ?
"picometer"
125 : u ==
"nm" ?
"nanometer"
126 : u ==
"um" ?
"micrometer"
127 : u ==
"mm" ?
"millimeter"
128 : u ==
"cm" ?
"centimeter"
129 : u ==
"dm" ?
"decimeter"
131 : u ==
"km" ?
"kilometer"
132 : u ==
"thou" ?
"thousandth"
133 : u ==
"mil" ?
"thousandth"
158 d == 1 ? length_unit_name_1d( u )
159 : d == 2 ? str( length_unit_name_1d( u ),
"^2" )
160 : d == 3 ? str( length_unit_name_1d( u ),
"^3" )
165 d == 1 ? length_unit_name_1d( u )
166 : d == 2 ? str(
"square ", length_unit_name_1d( u ) )
167 : d == 3 ? str(
"cubic ", length_unit_name_1d( u ) )
181 function length_unit_mm2
185 ) = to ==
"pm" ? ( v * 1000000000.0 )
186 : to ==
"nm" ? ( v * 1000000.0 )
187 : to ==
"um" ? ( v * 1000.0 )
189 : to ==
"cm" ? ( v / 10.0 )
190 : to ==
"dm" ? ( v / 100.0 )
191 : to ==
"m" ? ( v / 1000.0 )
192 : to ==
"km" ? ( v / 1000000.0 )
193 : to ==
"thou" ? ( v / 0.0254 )
194 : to ==
"mil" ? ( v / 0.0254 )
195 : to ==
"in" ? ( v / 25.4 )
196 : to ==
"ft" ? ( v / 304.8 )
197 : to ==
"yd" ? ( v / 914.4 )
198 : to ==
"mi" ? ( v / 1609344.0 )
211 function length_unit_2mm
215 ) = v / length_unit_mm2( 1, from );
234 : length_unit_mm2( length_unit_2mm( v, from ), to );
253 ) = d == 1 ? ( length_1d(v, from, to) )
256 : d == 2 ? pow( length_1d(v, from, to), 2 )
257 : d == 3 ? pow( length_1d(v, from, to), 3 )
278 ) = d == 1 ? length_1d(v, from, to)
281 : d == 2 ? length_1d(pow(v, 1/2), from, to)
282 : d == 3 ? length_1d(pow(v, 1/3), from, to)
function l_in(v)
Shorthand length conversion for inches.
function length(v, from=length_unit_default, to=length_unit_base, d=1)
Convert a value from from one units to another with dimensions.
function length_unit_name(u=length_unit_default, d=1, w=false)
Return the name for a length unit identifier with dimension.
length_unit_default
<string> The default units when unspecified.
function length_inv(v, from=length_unit_base, to=length_unit_default, d=1)
Convert a value from from one units to another with dimensions.
function l_mm(v)
Shorthand length conversion for millimeters.
length_unit_base
<string> The base units for value storage.