zigante
v2.1.1
Published
Use this package to help on your day by day.
Downloads
9
Maintainers
Readme
Description
The official Zigante driver for Node.js. Provides a high-level API with the most important and most used math operations and geometric shapes.
Zigante Node.JS Driver
The recommended way to get started using the Node.js 3.0 driver is by using the npm
(Node Package Manager) to install the dependency in your project.
Zigante Driver
Given that you have created your own project using npm init
we install the Zigante driver and its dependencies by executing the following npm
command.
npm install zigante --save
This will download the Zigante driver and add a dependency entry in your package.json
file.
You can also use the Yarn package manager.
Troubleshooting
The Zigante driver depends on other packages. These are:
Quick Start
Create the package.json
file
First, create a directory where your application will live.
mkdir myproject
cd myproject
Enter the following command and answer the questions to create the initial structure for your new project:
npm init
Next, install the driver dependency.
npm install zigante --save
You should see NPM download a lot of files. Once it's done you'll find all the downloaded packages under the node_modules directory.
Use Zigante
Create a new index.js file and add the following code to use the Zigante driver.
###MathOperations
//Example 01
import { mathOperations } from "zigante";
const sum = mathOperations.sum(5, 6, 7);
console.log(sum);
/** output:
* 18
*/
//Example 02
import { mathOperations } from "zigante";
const bhaskara = mathOperations.bhaskara(1, 2, -3);
console.log(bhaskara);
/** output:
* {
* equation: '1x^2 + 2x + -3',
* delta: 16,
* x1: 1,
* x2: -3,
* solutions: [ 1, -3 ]
* }
*/
Run your app from the command line with:
npm start
The application should print the operations result to the console.
###GeoForms
//Example 01
import { geoShapes } from "zigante";
const rectangle = geoShapes.rectangle(2, 3);
console.log(rectangle);
/** output:
* {
* area: 6,
* perimeter: 13,
* diagonal: 3.605551275463989,
* base: 2,
* height: 3
* }
*/
//Example 02
import { geoShapes, mathOperations } from "zigante";
const perimeter = mathOperations.round(geoShapes.triangle.rectangle(3, 5).perimeter, 5);
console.log(perimeter);
/** output:
* 13.83095
*/
Run your app from the command line with:
npm start
The application should print the operations result to the console.
Next Steps
License
© 2012-present Pedro Zigante Martim © 2012-present ZIGANTE