CommandLine_desc_en.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <div>
  2. <p>The command line of QCAD allows you to start commands, enter coordinates or
  3. enter values such as distances or radii.</p>
  4. <h3>Entering Coordinates</h3>
  5. <p>
  6. Absolute coordinates are entered in the format "x,y":
  7. </p>
  8. <p class="code">
  9. 40,5
  10. </p>
  11. <p>
  12. Relative coordinates are entered in the format "@x,y":
  13. </p>
  14. <p class="code">
  15. @10,6
  16. </p>
  17. <p>
  18. Absolute polar coordinates are entered in the format "distance&lt;angle":
  19. </p>
  20. <p class="code">
  21. 10&lt;30
  22. </p>
  23. <p>
  24. Relative polar coordinates are entered in the format "@distance&lt;angle":
  25. </p>
  26. <p class="code">
  27. @10&lt;45
  28. </p>
  29. <p>
  30. When entering coordinates or values, <a href="#expr">mathematical expressions</a>
  31. may be used to calculate a coordinate based on known values. For example the
  32. coordinate 10,5 may also be entered as:
  33. </p>
  34. <p class="code">
  35. 5+5,30/6
  36. </p>
  37. <h3>Calculator</h3>
  38. <p>
  39. The command line can also be used as a calculator. To do this, enter a
  40. <a href="#expr">mathematical expression</a> proceeded by an equal sign:
  41. </p>
  42. <p class="code">
  43. =3+4<br/>
  44. 7
  45. </p>
  46. <p>
  47. Variables may be used to store values:
  48. </p>
  49. <p class="code">
  50. =a=5+6<br/>
  51. 11<br/>
  52. =a/2<br/>
  53. 5.5<br/>
  54. </p>
  55. <a name="expr"></a>
  56. <h3>Mathematical Expressions</h3>
  57. <p>Mathematical constants available are:</p>
  58. <p class="code">
  59. PI, LN2, LN10, LOG2E, LOG10E, SQRT1_2, SQRT2
  60. </p>
  61. <p>Mathematical functions available are:</p>
  62. <p class="code">
  63. abs, ceil, floor, exp, log, max, min, pow, sqrt, random, round, rad2deg, deg2rad,
  64. sin, cos, tan, asin, acos, atan, atan2, log10, log1p, log2, sign, cosh, sinh, tanh,
  65. acosh, asinh, atanh, expm1, hypot, cbrt, trunc
  66. </p>
  67. <p>Most of these constants and functions are standard ECMAScript (JavaScript) functions and
  68. documented online. In standard ECMAScript, these functions are part of the Math class so the
  69. function <i>abs</i> would have to written as <i>Math.abs</i>. In the QCAD command line, you can
  70. leave away the <i>Math.</i> part for convenience. Trigonometric functions (sin, cos, tan, asin, acos, atan, atan2)
  71. accept or return angles in degrees. If you prefer the radian versions of these functions,
  72. use the original <i>Math.</i> functions instead.</p>
  73. <p>The functions <i>rad2deg</i> and <i>deg2rad</i> can be used to convert angles between
  74. radian and degrees.</p>
  75. </div>