Coder Social home page Coder Social logo

syed25794 / calculate3dgeometrypropeties Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 935 KB

A npm package that helps you to calculate properties of 3D shapes like volume, surface area, and curved surface area.

License: MIT License

JavaScript 100.00%
3d-geometry cube geometry javascript cone cuboid cylinder prism pyramid torus

calculate3dgeometrypropeties's Introduction

3D Geometry

Cube,Cuboid,Prism

A npm package that helps you to calculate properties of 3D shapes like volume, surface area, and curved surface area.

Description

The 3D Geometry package provides a simple and easy to use function that can calculate the properties of various 3D shapes like cube, cuboid, sphere, cylinder, cone, torus, prism, pyramid and more. You just need to provide the shape, property and the parameters required by that shape to get the result.

Features

  • Calculate the properties of various 3D shapes like cube, cuboid, sphere, cylinder, cone, torus, prism, pyramid and more.
  • Properties like volume, surface area, and curved surface area can be calculated.
  • Easy to use and understand.

Usage

You can use this packages to calculate different properties of three dimensional shapes

  • Till now we have the following shapes only 1.Cube 2.Cuboid 3.Sphere 4.Cone 5.Cylinder 6.Torus 7.Prism 8.Pyramid

  • Till now we have the following properties only 1.Volume - for volume property you have to give it as "volume" 2.Curverd Surface Area - for this property use "csa" as the value of property 3.Surface Area - for this property use "sa" as the value of the property

const { calculate3dShapesProperty } = require('3dgeometry');

const shape = "cube";
const property = "volume";
const parameters = {side: 2};

console.log(calculate3dShapesProperty(shape, property, parameters));



const { calculate3dShapesProperty } = require('3dgeometry');

// 1. Cube Volume
const shape1 = "cube";
const property1 = "volume";
const parameters1 = {side: 2};
console.log(calculate3dShapesProperty(shape1, property1, parameters1));

// 2. Sphere Volume
const shape2 = "sphere";
const property2 = "volume";
const parameters2 = {radius: 2};
console.log(calculate3dShapesProperty(shape2, property2, parameters2));

// 3. Cylinder Volume
const shape3 = "cylinder";
const property3 = "volume";
const parameters3 = {radius: 2, height: 3};
console.log(calculate3dShapesProperty(shape3, property3, parameters3));

// 4. Cube Surface Area
const shape4 = "cube";
const property4 = "surface_area";
const parameters4 = {side: 2};
console.log(calculate3dShapesProperty(shape4, property4, parameters4));

// 5. Sphere Surface Area
const shape5 = "sphere";
const property5 = "surface_area";
const parameters5 = {radius: 2};
console.log(calculate3dShapesProperty(shape5, property5, parameters5));

// 6. Cylinder Surface Area
const shape6 = "cylinder";
const property6 = "surface_area";
const parameters6 = {radius: 2, height: 3};
console.log(calculate3dShapesProperty(shape6, property6, parameters6));

Note

The package assumes that you pass the correct parameter for the shape you have selected. It's always a good practice to validate the input before passing it to the function.

Contribution

If you want to contribute to this package or have any suggestions or questions, please feel free to open an issue or pull request.

License

This package is licensed under the MIT license. Want to read Click On Me

calculate3dgeometrypropeties's People

Contributors

syed25794 avatar

Stargazers

 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.