quantity 5.0.0 copy "quantity: ^5.0.0" to clipboard
quantity: ^5.0.0 copied to clipboard

Facilitates working with physical quantities such as angles, lengths, masses, temperatures and many others. Supports uncertainty and arbitrary precision.

example/README.md

The example folder contains some example code to help you get started with the quantity package.

Angles Example #

  // Import the quantity library.
  import 'package:quantity/quantity.dart';

  // Construct an Angle using fluent extension.
  final ang = 1.1.radians;
  print('Angle1 (deg): ${ang.inDegrees}');

  // Construct an Angle in degrees.
  final ang2 = 270.degrees;
  print('Angle2 (deg): $ang2');

  // Find the difference.
  final diff = ang2 - ang as Angle;

  // Display the result in degrees.
  print('Difference (deg): ${diff.inDegrees}');

  // Display the result in radians.
  print('Difference (rad): ${diff.inRadians}');

  // Find the sum.
  final sum = ang2 + ang as Angle;

  // Display the result in degrees.
  print('Sum (deg): ${sum.inDegrees}');

  // Display the result in radians.
  print('Sum (rad): ${sum.inRadians}');
12
likes
160
points
4.1k
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

Facilitates working with physical quantities such as angles, lengths, masses, temperatures and many others. Supports uncertainty and arbitrary precision.

Repository (GitHub)
View/report issues

Topics

#physics #units-of-measure #measurement #scientific #uncertainty

License

MIT (license)

Dependencies

decimal, intl, logging

More

Packages that depend on quantity