Skip to content

Commit

Permalink
1.2.0
Browse files Browse the repository at this point in the history
Added the golden ratio.
  • Loading branch information
TheYule committed Jul 11, 2021
1 parent 4b13b6f commit 76f1821
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/cjs/YooMath.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ interface YooMath {
readonly SQRT1_2: number;
/** The square root of `2`. */
readonly SQRT2: number;
/** Also known as `φ` (the Greek letter "phi"). The golden ratio, which people also call the golden proportion or golden section, is the calculation you obtain from two segment lengths with the same portion of their sum to the larger sum of two lengths. */
readonly GR: number;
/**
* Returns true if `x` is negative.
* @param {number} x A numeric expression.
Expand Down
1 change: 1 addition & 0 deletions lib/cjs/YooMath.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ exports.YooMath = {
PI: 3.1415926535897931,
SQRT1_2: .7071067811865476,
SQRT2: 1.4142135623730951,
GR: 1.618033988749895,
isNegative(x) { return x < 0 ? true : false; },
pow(x, y) { return Math.pow(x, y); },
sqed(x) { return this.pow(x, 2); },
Expand Down
2 changes: 2 additions & 0 deletions lib/esm/YooMath.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ interface YooMath {
readonly SQRT1_2: number;
/** The square root of `2`. */
readonly SQRT2: number;
/** Also known as `φ` (the Greek letter "phi"). The golden ratio, which people also call the golden proportion or golden section, is the calculation you obtain from two segment lengths with the same portion of their sum to the larger sum of two lengths. */
readonly GR: number;
/**
* Returns true if `x` is negative.
* @param {number} x A numeric expression.
Expand Down
1 change: 1 addition & 0 deletions lib/esm/YooMath.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const YooMath = {
PI: 3.1415926535897931,
SQRT1_2: .7071067811865476,
SQRT2: 1.4142135623730951,
GR: 1.618033988749895,
isNegative(x) { return x < 0 ? true : false; },
pow(x, y) { return Math.pow(x, y); },
sqed(x) { return this.pow(x, 2); },
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yoo-babobo/yoo-math.js",
"version": "1.1.0",
"version": "1.2.0",
"description": "A simple math library that adds extra and useful functions to your project.",
"main": "./lib/cjs/YooMath.js",
"module": "./lib/esm/YooMath.js",
Expand Down
3 changes: 3 additions & 0 deletions src/YooMath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ interface YooMath {
readonly SQRT1_2: number,
/** The square root of `2`. */
readonly SQRT2: number,
/** Also known as `φ` (the Greek letter "phi"). The golden ratio, which people also call the golden proportion or golden section, is the calculation you obtain from two segment lengths with the same portion of their sum to the larger sum of two lengths. */
readonly GR: number,
/**
* Returns true if `x` is negative.
* @param {number} x A numeric expression.
Expand Down Expand Up @@ -266,6 +268,7 @@ export const YooMath: YooMath = {
PI: 3.1415926535897931,
SQRT1_2: .7071067811865476,
SQRT2: 1.4142135623730951,
GR: 1.618033988749895,
isNegative(x) { return x < 0 ? true : false; },
pow(x, y) { return x ** y; },
sqed(x) { return this.pow(x, 2); },
Expand Down

0 comments on commit 76f1821

Please sign in to comment.