GithubHelp home page GithubHelp logo

ebube4im / electricitycalculator Goto Github PK

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

A comprehensive tool to help in any Electricity related projects. It contains functions such as AddResistors(), Calculate Resistance from color codes, Electrical Power, Capacitance etc. The project is open to contributions. Send a PR and I would be glad to have you on board.

C# 100.00%

electricitycalculator's Introduction

Electricity Calculator - NugetPackage

This is a Comprehensive Library created to help in Electricity Solutions with functions to help perform electrical calculations such as calulating resistor values, adding resistor values in parallel and series, evaluating Electrical Power, Capacitance etc.

How to Use the Library/Nuget package

  • Install the Nuget package into your project

  • Add the Library Refrences where needed using ElectricityCalculator;

  • To Add Resistor values in Series, Simply Call the Add Static method and pass in an array of the values: Resistor.AddParallel(double[] values) Resistor.AddSeries(double[] values)

  • To calculate resistor value based on resistance code, instantiate the resistor class and initialize the properties such as color bands, multiplier color, tolerance color and temperature colors.

  • Call the Calulate method and pass in the resistor obeject created. resistor.CalulateColorCode(resistor)

Classes Used

The following classes were implemented and can be called. Resistor.cs - Containes properties that can be set to represent a given resistor with resistor values.

Properties -

public ResistorBands BandType decimal Value Colors Band1 Colors Band2 Colors Band3 Colors Multiplier Colors Tolerance Colors TemperatureCoefficient { get; set; }

Methods

public static double AddSeries(double[] values)

  • Takes in an array of resistor values and returns the result after adding serially

public static double AddParallel(double[] values)

  • Takes in an array of resistor values and returns the result after adding parallelly

public string CalulateColorCode(Resistor resistor)

  • Takes in a Resistor object and Calulates the value of the resistor based on the Color Bands

Enums

ResistorBands

public enum ResistorBands { _3Band = 1, _4Band, _5Band, _6Band }

ColorCodes

public enum Colors { Black = 0, Brown, Red, Orange, Yellow, Green, Blue, Violet, Grey, White, Gold, Silver }

electricitycalculator's People

Contributors

ebube4im 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.