Skip to content

This library will support you to measure the quantities involved in physics. Among these quantities are length, time, mass, temperature, pressure, and electric current.

License

Notifications You must be signed in to change notification settings

victorpotasso/physics-measurement

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Physics Measurement

This library will support you to measure the quantities involved in physics. Among these quantities are length, time, mass, temperature, pressure, and electric current.

Github:

https://github.com/victorpotasso/physics-measurement

Email:

[email protected]

Dependences:

grunt-coffee-import

jQuery

Sample

Creating a quantity

var q = new Quantity(666, "km");

Convertion a quantity unit to another

q.to("m");

Select unit

Unit.instance().select("kg");

Select All units

Unit.instance().selectAll();

Select All units of a specific base quantity

Unit.instance().selectAllByBaseQuantity("length");

Quantity

Property

_quantity : Number Unit's quantity

_unit : String Unit class that represents this Quantity

Functions

quantity() : Number - returns @_quantity unit() : Number - returns @_unit to(p_unit) : String - return the conversion of the unit of this quantity.

Unit

Unit is a Singleton class.

Property

_quantity : Number Unit's quantity

_unit : String Unit class that represents this Quantity

Functions

select(p_unitSymbol) : Unit Object - returns an Unit object by symbol. selectAll() : Array - returns a list of all Unit objects. selectAllByBaseQuantity(p_baseQuantity) : Array - returns a list of Unit object of a specif Base Quantity. isValid() : Boolean - check if this Unit is valid.

SIUnitPrefix

Prefixes for SI Units. It's a Singleton Class

Functions

select(p_unitPrefix) : SIUnitPrefix Object - returns an SIUnitPrefix object by prefix. selectAll() : Array - returns a list of all SIUnitPrefix objects.

BaseQuantity

Variables

MASS: "mass"

TIME: "time"

LENGTH: "length"

Functions

select(p_unitSymbol) : Unit Object - returns an BaseQuantity object by unit's symbol. selectAll() : Array - returns a list of all BaseQuantity objects.

License

MIT © Victor Potasso

About

This library will support you to measure the quantities involved in physics. Among these quantities are length, time, mass, temperature, pressure, and electric current.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published