meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
en:math_guide_conversions [2021/05/01 04:36] JSCAD Editor |
en:math_guide_conversions [2022/04/16 04:28] (current) rozek included "require" statements |
||
|---|---|---|---|
| Line 6: | Line 6: | ||
| <code javascript> | <code javascript> | ||
| + | const { degToRad } = require(' | ||
| let radians = degToRad(90) // PI / 2 radians | let radians = degToRad(90) // PI / 2 radians | ||
| </ | </ | ||
| Line 12: | Line 13: | ||
| <code javascript> | <code javascript> | ||
| + | const { radToDeg } = require(' | ||
| let degrees = radToDeg(Math.PI / 2) // 90 degrees | let degrees = radToDeg(Math.PI / 2) // 90 degrees | ||
| </ | </ | ||
| Line 17: | Line 19: | ||
| ==== Conversions of Radius to Segments ==== | ==== Conversions of Radius to Segments ==== | ||
| - | Calculate the number of segments | + | Calculate the number of segments |
| - | There are various round shapes that support the ' | + | There are various round shapes that support the ' |
| + | |||
| + | This function | ||
| + | |||
| + | Using the above example, the arc has a radius of 3.5 mm (units are typically mm). The laser printer requires 0.1 mm segments | ||
| <code javascript> | <code javascript> | ||
| + | const { radiusToSegments } = require(' | ||
| + | |||
| let segments = radiusToSegments(3.5, | let segments = radiusToSegments(3.5, | ||
| let segments = radiusToSegments(3.5, | let segments = radiusToSegments(3.5, | ||
| </ | </ | ||
| + | |||
| + | //NOTE: The number of segments can become large depending on the ' | ||