• Example
• Installing
• Versions
• 74

# dart-angles #

Never ever suffix your angle variables with `...degress` or `...rad` and forget about manual angle conversions like `x * rad2deg`!

This library provides a single class named `Angle`, wrapping your angle variables in a far more readable way, whereas raw doubles aren't very expressive about how they store their values. One can create an angle from various units, including degrees, radians, gradians and turns.

``````
// Various ways to define a half turn:
x = Angle.fromDegrees(180.0);
z = Angle.fromTurns(0.5);

x.degrees; // = 180.0
x.turns;   // = 0.5

``````

One can use built-in trigonometric functions:

``````
x = Angle.asin(0.3);
y = x.sin; // = 0.3

``````

Angles are immutable, but there are operators like `+`, creating new angles:

``````
x = Angle.halfTurn() + Angle.fromDegrees(90.0);

``````

example/angles_example.dart

``````import 'package:angles/angles.dart';
import 'dart:math' as math;

main() {
// Various ways to define a half turn:
final x = Angle.fromDegrees(180.0);
final z = Angle.fromTurns(0.5);

x.degrees; // = 180.0
x.turns;   // = 0.5

// One can use built-in trigonometric functions:
final a = Angle.asin(0.3);
print(a.sin); // = 0.3

// Angles are immutable, but there are operators like +, creating new angles:
final threeQuarterTurn = Angle.halfTurn() + Angle.fromDegrees(90.0);
print(threeQuarterTurn); // 270°
}
``````

## Use this package as a library

### 1. Depend on it

``````
dependencies:
angles: ^1.0.0

``````

### 2. Install it

You can install packages from the command line:

with pub:

``````
\$ pub get

``````

with Flutter:

``````
\$ flutter packages get

``````

Alternatively, your editor might support `pub get` or `flutter packages get`. Check the docs for your editor to learn more.

### 3. Import it

Now in your Dart code, you can use:

``````
import 'package:angles/angles.dart';
``````
1.0.0 Sep 23, 2018
 Popularity: Describes how popular the package is relative to other packages. [more] 55 Health: Code health derived from static analysis. [more] 100 Maintenance: Reflects how tidy and up-to-date the package is. [more] 80 Overall: Weighted score of the above. [more] 74

We analyzed this package on Feb 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

• Dart: 2.1.0
• pana: 0.12.13+1

#### Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library `package:angles/angles.dart`.

#### Maintenance issues and suggestions

Provide a file named `CHANGELOG.md`. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by `stagehand`.

#### Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
meta ^1.0.0 1.1.7
Dev dependencies
test ^1.0.0