You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.7 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2011-2014 Jean-Pierre Charras
  5. * Copyright (C) 2004-2016 KiCad Developers, see AUTHORS.txt for contributors.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; either version 3
  10. * of the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along
  18. * with this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. /*
  21. * @file units_scales.h
  22. */
  23. // Inside calculations, units are always meter, Hz, Ohm and Radian
  24. // These units are not very easy to handle, so we use conversion constants
  25. #ifndef UNITS_SCALES_H
  26. #define UNITS_SCALES_H
  27. #define UNIT_MM 1e-3 // mm to meter
  28. #define UNIT_CM 1e-2 // cm to meter
  29. #define UNIT_MICRON 1e-6 // um to meter
  30. #define UNIT_INCH (1e-2*2.54) // inch to meter
  31. #define UNIT_MIL (1e-5*2.54) // mil (or thou) to meter
  32. #define UNIT_OZSQFT (34.40*UNIT_MICRON) // 1 oz/ft^2 is 34.30 microns nominal, 30.90 minimum
  33. #define UNIT_GHZ 1e9
  34. #define UNIT_MHZ 1e6
  35. #define UNIT_KHZ 1e3
  36. #define UNIT_DEGREE (M_PI/180.0) // degree to radian
  37. #define UNIT_RADIAN 1.0 // Radian to radian
  38. #define UNIT_OHM 1.0 // Ohm to Ohm
  39. #define UNIT_KOHM 1e3 // KOhm to Ohm
  40. #endif // UNITS_SCALES_H