GithubHelp home page GithubHelp logo

mathcraft's Introduction

PyLab

Python Laboratory. Our purpose is to provide a simple toolbox, with a wide-range of features, that allows academics, STEM students and entushiasts on building their applications simple as possible.

How to Install

We've uplaoded to PyPi organization, so you can install it as follows:

pip install mathcraft

Dependencies

  • Python 3.9 or above.

MathCraft is build using NumPy. We include also beartype dependency because we want to guarantee code quality and coverage across the time.

How to Use

Vector Class

The Vector class provides a NumPy array-like initialization, however it enforces the shape (N, 1) of the vector.

from mathcraft import Vector

x1 = Vector([1, 2, 3])
x2 = Vector(np.array([3, 4, 5, 1, 3, 5]))

We included a method to make simpler the computation of the vector norm.

v = Vector([1, 2, 3, 4, 5, 6])
norm = v.norm()

print(norm)

You can also return a normalized vector if you already have created one:

v = Vector([1, 2, 3, 4, 5, 6])
w = Vector([1, 2, 3, 4, 5, 6])

dotProd_vw = v.normalized().T @ w.normalized()
print(dotProd_vw)

Matrix Class

The same for our Matrix class:

from mathcraft import Matrix

A = Matrix([[2, 3], [4, 5]])
B = Matrix(np.array([[2, 3], [4, 5]]))

We included methods to make the computation of determinant and inverse/pseudo-inverse easier:

A = Matrix([[2, 3], [4, 5]])
print(A.inv())
print(A.det())
print(A.pinv())
print(A.T)

Contribute

If you want to contribute to the project, check the TODO file. Create your code and do a PR.

mathcraft's People

Contributors

mbenencase avatar

Watchers

 avatar

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.