0.2.2 • Published 2 years ago

@bothrs/math v0.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@bothrs/math

Utility methods for solving common mathematical issues.

Getting started

yarn add @bothrs/math

Contents

Conversion

  • toDegrees: Convert a radian value to degrees.
  • toRadians: Convert a degree value to radians.

Image

  • calculateScaleRatioFit: Calculate the linear scale ratio in which an image fits inside the requested container.

Matrix

  • getScalingMatrix
  • getTranslationMatrix
  • getRotationMatrix
  • getSVGTransformMatrix: Render out a transform matrix as an SVG Transform string.
  • getTransformMatrix: Generate a transform matrix with common edits and defaults.
  • multiplyMatrices

Number

  • getRandomInt: Generate a random integer between 2 values.
  • toFixed: Round a number to a fixed amount of fraction digits.
0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.7

2 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.0

4 years ago