Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@daeinc/math

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@daeinc/math - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

7

dist/index.d.ts

@@ -90,2 +90,9 @@ /**

/**
* converts polar coordinate to cartesian. to update center, result.map((v,i)=> v + center[i])
* @param radius
* @param angle in radians
* @returns
*/
export declare const polarToCartesian: (radius: number, angle: number) => number[];
/**
* reflect a scalar value along axis. good for creating reflected version.

@@ -92,0 +99,0 @@ * @param num number to flip

17

dist/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.snapToArray = exports.snapBy = exports.roundF = exports.reflect = exports.modIncl = exports.modF = exports.mod = exports.lerp = exports.mix = exports.map = exports.floorF = exports.distSq = exports.dist = exports.constrain = exports.clamp = void 0;
exports.snapToArray = exports.snapBy = exports.roundF = exports.reflect = exports.polarToCartesian = exports.modIncl = exports.modF = exports.mod = exports.lerp = exports.mix = exports.map = exports.floorF = exports.distSq = exports.dist = exports.constrain = exports.clamp = void 0;
/**

@@ -109,2 +109,7 @@ * clamp values between min and max (=constrain)

exports.modF = modF;
// export const floorF = (n: number, digit: number): number => {
// n = parseFloat(n.toFixed(digit));
// const factor = Math.pow(10, digit);
// return Math.floor(n * factor) / factor;
// };
/**

@@ -124,2 +129,12 @@ * inclusive modulo. modIncl(1, 3) will include 3.

/**
* converts polar coordinate to cartesian. to update center, result.map((v,i)=> v + center[i])
* @param radius
* @param angle in radians
* @returns
*/
const polarToCartesian = (radius, angle) => {
return [Math.cos(angle) * radius, Math.sin(angle) * radius];
};
exports.polarToCartesian = polarToCartesian;
/**
* reflect a scalar value along axis. good for creating reflected version.

@@ -126,0 +141,0 @@ * @param num number to flip

2

package.json
{
"name": "@daeinc/math",
"version": "0.2.0",
"version": "0.3.0",
"description": "Math utilities",

@@ -5,0 +5,0 @@ "types": "./dist/index.d.ts",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc