GithubHelp home page GithubHelp logo

kapcash / ts-matrix Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matthiasferch/tsm

11.0 11.0 1.0 5.53 MB

A TypeScript vector and matrix math library.

License: Other

TypeScript 99.10% JavaScript 0.90%

ts-matrix's Introduction

Welcome here! ๐Ÿ‘‹


GIF

I'm Florent

I'm French ๐Ÿ‡ซ๐Ÿ‡ท but I live in Barcelona, Spain ๐Ÿ‡ช๐Ÿ‡ธ.
I graduated from the ESIR engineering school in Computer Sciences.

I speak about my developer journey on Twitter too (@kapcash)

My work

vuejs I'm a Vuejs developer.

nuxtjs And I mainly use the Nuxt framework to build apps.

I also have experience in NodeJS, using the NestJS framework, and in Ruby On Rails.

The work I am most proud of: (aka. the only personal projects I managed to release)

  • bookmark-switcher: A browser extension built with Vue 3 to provide multiple bookmark bars
  • vue-class-transformer: A CLI that transforms vanilla Vuejs components to Typescript class based components
  • vue-spin-wheel: A renderless wheel component that moves on user interactions

My Github stats

Kapcash's github stats

ts-matrix's People

Contributors

benjajaja avatar flbn avatar kapcash avatar matthiasferch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

flbn

ts-matrix's Issues

Quat import error:

In ts-matrix.d.ts there in an import error:

import Matrix from './Matrix';
import Quat from './Quat';
import Vector from './Vector';
export { Vector, Matrix, Quat, };

File ./Quat does not exist.
Exist ./quat

This creates a compilation error.
Can you fix it?

Thank you

Error in matrix inverse()

Hi, found a sign error in the matrix inverse, that the tests (only 1 inverse() test) did not catch. See inverse code below with the new fix added:

    inverse() {
        if (this.rows !== this.columns) throw new Error("The matrix isn't squared!");
        const det = this.determinant();
        if (det === 0) throw new Error("Determinant is 0, can't compute inverse.");

        // Get cofactor matrix
        let sign = -1;
        const cofactor = new Matrix (this.rows, this.columns,
            this.values.map((row, i) => row.map((val, j) => {
                sign = Math.pow(-1,i+j);           /////////////////////////////////// FIXED THIS LINE ////////////////
                return sign * this.getCofactor(i, j).determinant();
            })));
        // Transpose it
        const transposedCofactor = cofactor.transpose();
        // Compute inverse of transposed / determinant on each value
        return new Matrix(this.rows, this.columns,
            this.values.map((row, i) => row.map((val, j) => transposedCofactor.at(i, j) / det)));
    }

Need to add target: 'node in webpack config

Hi, I got an error testing with jest, complaining 'window' is used. After adding ** target: 'node' ** in webpack.config.js, this was resolved.

const path = require('path');

module.exports = {
  entry: './src/ts-matrix.ts',
  devtool: 'inline-source-map',
  mode: 'production',
  target: 'node',
  module: {
    rules: [
      {
        test: /\.ts$/,
        use: 'ts-loader',
        exclude: /node_modules/
      }
    ]
  },
  resolve: {
    extensions: ['.ts']
  },
  output: {
    library: 'tsmatrix',
    libraryTarget: 'umd',
    filename: 'tsmatrix.js',
    path: path.resolve(__dirname, 'dist')
  }
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.