@khanacademy/kmath 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
12
12
 
13
13
  // This file is processed by a Rollup plugin (replace) to inject the production
14
14
  const libName = "@khanacademy/kmath";
15
- const libVersion = "0.3.2";
15
+ const libVersion = "0.3.4";
16
16
  perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
17
17
 
18
18
  /**
@@ -784,6 +784,11 @@ var geometry = /*#__PURE__*/Object.freeze({
784
784
  function convertDegreesToRadians(degrees) {
785
785
  return degrees / 180 * Math.PI;
786
786
  }
787
+ function convertRadiansToDegrees(radians) {
788
+ const degree = radians / Math.PI * 180;
789
+ // Account for floating point errors.
790
+ return Number(degree.toPrecision(15));
791
+ }
787
792
 
788
793
  // Returns a value between -180 and 180, inclusive. The angle is measured
789
794
  // between the positive x-axis and the given vector.
@@ -839,6 +844,7 @@ const getClockwiseAngle = function (coords) {
839
844
  var angles = /*#__PURE__*/Object.freeze({
840
845
  __proto__: null,
841
846
  convertDegreesToRadians: convertDegreesToRadians,
847
+ convertRadiansToDegrees: convertRadiansToDegrees,
842
848
  calculateAngleInDegrees: calculateAngleInDegrees,
843
849
  polar: polar,
844
850
  getAngleFromVertex: getAngleFromVertex,