{"id":20778059,"url":"https://github.com/stackgl/gl-quat","last_synced_at":"2025-04-30T18:41:30.299Z","repository":{"id":32047173,"uuid":"35618734","full_name":"stackgl/gl-quat","owner":"stackgl","description":"gl-matrix's quaternion, split into smaller pieces","archived":false,"fork":false,"pushed_at":"2015-05-14T15:35:40.000Z","size":124,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-11-10T20:08:42.997Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackgl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-14T15:21:13.000Z","updated_at":"2022-02-26T17:30:19.000Z","dependencies_parsed_at":"2022-08-27T07:41:05.441Z","dependency_job_id":null,"html_url":"https://github.com/stackgl/gl-quat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-quat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-quat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-quat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-quat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackgl","download_url":"https://codeload.github.com/stackgl/gl-quat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225040930,"owners_count":17411562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T13:18:57.449Z","updated_at":"2024-11-17T13:18:58.012Z","avatar_url":"https://github.com/stackgl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gl-quat\n\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\nPart of a fork of [@toji](http://github.com/toji)'s\n[gl-matrix](http://github.com/toji/gl-matrix) split into smaller pieces: this\npackage contains `glMatrix.quat`.\n\n## Usage\n\n[![NPM](https://nodei.co/npm/gl-quat.png)](https://nodei.co/npm/gl-quat/)\n\n### `quat = require('gl-quat')`\n\nWill load all of the module's functionality and expose it on a single\nobject. Note that any of the methods may also be required directly\nfrom their files.\n\nFor example, the following are equivalent:\n\n``` javascript\nvar slerp = require('gl-quat').slerp\nvar slerp = require('gl-quat/slerp')\n```\n\n## API\n\n  - [add()](#addoutquat-aquat-bquat)\n  - [calculateW()](#calculatewoutquat-aquat)\n  - [copy()](#copyoutquat-aquat)\n  - [conjugate()](#conjugateoutquat-aquat)\n  - [copy()](#copyoutquat-aquat)\n  - [create()](#create)\n  - [dot()](#dotaquat-bquat)\n  - [fromMat3()](#frommat3outquat-mmat3)\n  - [fromValues()](#fromvaluesxnumber-ynumber-znumber-wnumber)\n  - [identity()](#identityoutquat)\n  - [invert()](#invertoutquat-aquat)\n  - [length()](#lengthaquat)\n  - [lerp()](#lerpoutquat-aquat-bquat-tnumber)\n  - [multiply()](#multiplyoutquat-aquat-bquat)\n  - [normalize()](#normalizeoutquat-aquat)\n  - [rotateX()](#rotatexoutquat-aquat-radnumber)\n  - [rotateY()](#rotateyoutquat-aquat-radnumber)\n  - [rotateZ()](#rotatezoutquat-aquat-radnumber)\n  - [rotationTo()](#rotationtooutquat-avec3-bvec3)\n  - [scale()](#scaleoutquat-aquat-bnumber)\n  - [set()](#setoutquat-xnumber-ynumber-znumber-wnumber)\n  - [setAxes()](#setaxesviewvec3-rightvec3-upvec3)\n  - [setAxisAngle()](#setaxisangleoutquat-axisvec3-radnumber)\n  - [slerp()](#slerpoutquat-aquat-bquat-tnumber)\n  - [sqlerp()](#sqlerpoutquat-aquat-bquat-cquat-dquat-tnumber)\n  - [squaredLength()](#squaredlengthaquat)\n\n## calculateW(out:quat, a:quat)\n\n  Calculates the W component of a quat from the X, Y, and Z components.\n  Assumes that quaternion is 1 unit in length.\n  Any existing W component will be ignored.\n\n## add(out:quat, a:quat, b:quat)\n\n  Adds two quat's\n\n## conjugate(out:quat, a:quat)\n\n  Calculates the conjugate of a quat\n  If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\n\n## copy(out:quat, a:quat)\n\n  Copy the values from one quat to another\n\n## create()\n\n  Creates a new identity quat\n\n## dot(a:quat, b:quat)\n\n  Calculates the dot product of two quat's\n\n## fromMat3(out:quat, m:mat3)\n\n  Creates a quaternion from the given 3x3 rotation matrix.\n  \n  NOTE: The resultant quaternion is not normalized, so you should be sure\n  to renormalize the quaternion yourself where necessary.\n\n## fromValues(x:Number, y:Number, z:Number, w:Number)\n\n\n## identity(out:quat)\n\n  Set a quat to the identity quaternion\n\n## invert(out:quat, a:quat)\n\n  Calculates the inverse of a quat\n\n## length(a:quat)\n\n  Calculates the length of a quat\n\n## lerp(out:quat, a:quat, b:quat, t:Number)\n\n  Performs a linear interpolation between two quat's\n\n## multiply(out:quat, a:quat, b:quat)\n\n  Multiplies two quat's\n\n## normalize(out:quat, a:quat)\n\n  Normalize a quat\n\n## rotateX(out:quat, a:quat, rad:number)\n\n  Rotates a quaternion by the given angle about the X axis\n\n## rotateY(out:quat, a:quat, rad:number)\n\n  Rotates a quaternion by the given angle about the Y axis\n\n## rotateZ(out:quat, a:quat, rad:number)\n\n  Rotates a quaternion by the given angle about the Z axis\n\n## rotationTo(out:quat, a:vec3, b:vec3)\n\n  Sets a quaternion to represent the shortest rotation from one\n  vector to another.\n  \n  Both vectors are assumed to be unit length.\n\n## scale(out:quat, a:quat, b:Number)\n\n  Scales a quat by a scalar number\n\n## set(out:quat, x:Number, y:Number, z:Number, w:Number)\n\n  Set the components of a quat to the given values\n\n## setAxes(view:vec3, right:vec3, up:vec3)\n\n  Sets the specified quaternion with values corresponding to the given\n  axes. Each axis is a vec3 and is expected to be unit length and\n  perpendicular to all other specified axes.\n\n## setAxisAngle(out:quat, axis:vec3, rad:Number)\n\n  Sets a quat from the given angle and rotation axis,\n  then returns it.\n\n## slerp(out:quat, a:quat, b:quat, t:Number)\n\n  Performs a spherical linear interpolation between two quat\n\n## sqlerp(out:quat, a:quat, b:quat, c:quat, d:quat, t:Number)\n\n  Performs a spherical linear interpolation with two control points\n\n## squaredLength(a:quat)\n\n  Calculates the squared length of a quat\n\n## License\n\nMIT. See [LICENSE.md](http://github.com/stackgl/gl-quat/blob/master/LICENSE.md) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackgl%2Fgl-quat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackgl%2Fgl-quat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackgl%2Fgl-quat/lists"}