math_ops.scad 894 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. echo( "Random Vector: ",rands(5,15,4,42));
  2. echo( "abs: ",abs(-9));
  3. echo( "sign: ",sign(9));
  4. echo( "sign: ",sign(-9));
  5. echo( "cos: ",cos(9));
  6. echo( "sin: ",sin(9));
  7. echo( "tan: ",tan(9));
  8. echo( "acos: ",acos(0.1));
  9. echo( "asin: ",asin(0.1));
  10. echo( "atan: ",atan(9));
  11. echo( "atan2: ",atan2(1,2));
  12. echo( "min: ",min(1,2));
  13. echo( "max: ",max(1,2));
  14. echo( "pow: ",pow(1,2));
  15. echo( "sqrt: ",sqrt(2));
  16. echo( "ln: ",ln(1));
  17. echo( "ceil: ",ceil(2.5));
  18. echo( "ceil: ",ceil(-2.5));
  19. echo( "floor: ",floor(2.5));
  20. echo( "floor: ",floor(-2.5));
  21. echo( "log: ",log(10));
  22. echo( "log: ",log(10,2));
  23. echo( "exp: ",exp(2));
  24. echo("sign");
  25. echo(sign(-5.0));
  26. echo(sign(0));
  27. echo(sign(8.0));
  28. echo("round");
  29. echo(round(2.5));// = x+1.
  30. echo(round(2.49));// = x.
  31. echo(round(-(2.5)));// = -(x+1).
  32. echo(round(-(2.49)));// = -x.
  33. echo(round(5.4));// //-> 5
  34. echo(round(5.5));// //-> 6
  35. echo(round(5.6));// //-> 6
  36. sphere();