Mathematic Canvas Library
JavaScript HTML
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
__tests__
src
.gitignore
.travis.yml
CHANGELOG.md
CONTRIBUTING.md
LICENCE
README.md
canvasTest.html
canvasTest.js
graph.html
gulpfile.js
logo.png
package-lock.json
package.json
rollup.config.js
sample.html
yarn.lock

README.md

UnitaryJS

Build Status

logo.png

UnitaryJS is a library for handling canvas with objects.

Demo: Demo

Wiki

wiki

Quick Example

<!DOCTYPE html>
<html lang="ja">
  <head>
    <meta charset="UTF-8">
    <title>Sample</title>
    <script src="./unitary.js"></script>
    <script>
    const {Point, Triangle} = Unitary;
    const A = new Point(30,30),
        B = new Point(90,90),
        C = new Point(90,40),
        ABC = new Triangle(A, B, C),
        circumcircleABC = ABC.getCircumcircle(),
        incircleABC = ABC.getIncircle(),
        canvas = new Canvas('canvas');

    canvas.add(ABC);
    canvas.add(circumcircleABC);
    canvas.add(incircleABC);
    canvas.draw();
    </script>
  </head>
  <body>
    <canvas id="canvas" width="200" height="200"></canvas>
  </body>
</html>

Getting started

npm install unitaryjs

and require unitaryjs.

const Unitary = require('unitaryjs');
new Unitary.Vector(1, 1);

Browser

download ./dist/unitary.min.js and load it.

<script src="unitary.js"></script>

Classes

  • BezierCurve
  • Circle
  • CircularSector
  • Doughnut
  • Graph
  • Group
  • Image
  • Line
  • Point
  • Polygon
  • Quadrilateral
  • Rect
  • Segment
  • Text
  • Triangle
  • Vector