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

outdated

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 #

  // Construct an Angle in radians.
  final ang = new Angle(rad: 1.1);
  print('Angle1 (deg): ${ang.valueInUnits(Angle.degrees)}');

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

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

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

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

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

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

  // Display the result in radians.
  print('Sum (rad): ${sum.valueInUnits(Angle.radians)}');
12
likes
40
pub points
71%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

Documentation

Documentation

License

MIT (license)

Dependencies

intl, logging

More

Packages that depend on quantity