@chemistry/math
v3.1.3
Published
Math support for @chemistry project
Maintainers
Readme
@chemistry/math
Linear algebra library for 3D chemistry — vectors, matrices, quaternions, and transforms.
Installation
npm install @chemistry/mathUsage
import { Vec3, Matrix3x3, Quaternion, Transform3D } from '@chemistry/math';
const v = new Vec3(1, 2, 3);
const normalized = v.normalize();
const m = Matrix3x3.identity();
const transformed = m.multiplyVec3(v);
const q = new Quaternion(0, 0, 0, 1);
const rotated = q.rotate(v);Features
Vec2/Vec3— 2D and 3D vector operationsMatrix3x3/Matrix3x4— matrix operations and transformationsQuaternion— quaternion math for rotationsTransform3D— combined translation, rotation, and scale- Isomorphic — works in Node.js and browsers
License
MIT
