npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

anny.math

v0.1.6

Published

This is a basic Math package. It contains routines to work with matrices, quaternions and vectors. All those entities are represented as Float32Arrays. | Property | Description | | ------ | ------ | | ```Mathf.matrix4x4``` | access available matrix fun

Downloads

11

Readme

Math

This is a basic Math package. It contains routines to work with matrices, quaternions and vectors. All those entities are represented as Float32Arrays. | Property | Description | | ------ | ------ | | Mathf.matrix4x4 | access available matrix functions. | | Mathf.quaternion | access available quaternion functions. | | Mathf.vector | access available vector functions. | | Mathf.deg2Rad | use this to convert degrees to radians. | | Mathf.rad2Deg | use this to convert radians to degrees. |

| Method | Description | | ------ | ------ | | Mathf.asUint | convert number to uint32. | | Mathf.asInt | convert number to int32. | | Mathf.asFloat | convert number to float. |

Matrices

Matrices are stored in the column-major order | Method | Description | | ------ | ------ | | Mathf.matrix4x4.identity | gets the identity matrix .| | Mathf.matrix4x4.inverse | calculates full matrix inversion. | | Mathf.matrix4x4.scaleWithVector3 | constructs scale matrix from a given float3 vector containing the 3 axis scales. | | Mathf.matrix4x4.scaleWithNumber | constructs scale matrix from a given uniform scale value. | | Mathf.matrix4x4.mul | calculates the float4x4 matrix result of a matrix multiplication between a float4x4 matrix and a float4x4 matrix. | | Mathf.matrix4x4.set | sets matrix with rows. | | Mathf.matrix4x4.setWithMatrix | set matrix with values from another matrix. | | Mathf.matrix4x4.translateWithVector3 | calculates a float4x4 translation matrix given a float3 translation vector. | | Mathf.matrix4x4.setWithQuaternion | calculates a float4x4 matrix constructed from a quaternion. | | Mathf.matrix4x4.setWithQuaternionAndTranslate | calculates a float4x4 matrix constructed from a quaternion and a given float3 translation vector. |

Quaternions

| Method | Description | | ------ | ------ | | Mathf.quaternion.eulerXYZ | calculates a quaternion constructed by first performing a rotation around the x-axis, then the y-axis and finally the z-axis | | Mathf.quaternion.eulerXZY | calculates a quaternion constructed by first performing a rotation around the x-axis, then the z-axis and finally the y-axis. | | Mathf.quaternion.eulerYXZ | calculates a quaternion constructed by first performing a rotation around the y-axis, then the x-axis and finally the z-axis. | | Mathf.quaternion.eulerYZX | calculates a quaternion constructed by first performing a rotation around the y-axis, then the z-axis and finally the x-axis. | | Mathf.quaternion.eulerZXY | calculates a quaternion constructed by first performing a rotation around the z-axis, then the x-axis and finally the y-axis. | | Mathf.quaternion.eulerZYX | calculates a quaternion constructed by first performing a rotation around the z-axis, then the y-axis and finally the x-axis. | | Mathf.quaternion.mul | calculates the result of transforming the quaternion b by the quaternion a. |

Vectors

Vectors may be treated as Float32Arrays and also as instances of classes: Vector2, Vector3, Vector4 | Method | Description | | ------ | ------ | | Mathf.vector.add | returns a sum of two vectors element wise. | | Mathf.vector.sub | returns a subtraction of two vectors element wise. | | Mathf.vector.mul | returns a multiplication of two vectors element wise. | | Mathf.vector.scale | returns a multiplication of a vector by another vector element wise. | | Mathf.vector.div | returns a division of a vector and number element wise. | | Mathf.vector.inverse | returns vector inversion as 1 / v[i]. | | Mathf.vector.equals | returns true if vectors are equal. | | Mathf.vector.length | returns length(magnitude) of a vector. | | Mathf.vector.distance | returns distance between two points. | | Mathf.vector.dot | returns dot product of two vectors. | | Mathf.vector.cross | returns cross product of two vectors. |