Angle class

A planar (2-dimensional) angle, which has dimensions of 1 and is a measure of the ratio of the length of a circular arc to its radius.

Example usage:

// Construct an Angle in radians.
var ang = Angle(rad: 1.1);

// Construct an Angle in degrees.
var ang2 = Angle(deg: 270);

// Find the difference.
var diff = ang2 - ang;

// Display the result in degrees.
print(diff.valueInUnits(Angle.degrees));

See the Wikipedia entry for Angle for more information.

Inheritance
Implementers

Constructors

Angle({dynamic rad, dynamic deg, double uncert = 0.0})
Constructs an Angle with either radians (rad) or degrees (deg). Optionally specify a relative standard uncertainty.
Angle.constant(Number valueSI, {required AngleUnits units, double uncert = 0.0})
Constructs a constant angle.
const
Angle.fromDegMinSec(int d, int m, double s, [double uncert = 0.0])
This constructor creates an angle value from the three values passed in for degrees, minutes, and seconds of arc.
Angle.inUnits(dynamic value, AngleUnits? units, [double uncert = 0.0])
Constructs an Angle based on the value and the conversion factor intrinsic to the passed units.
Angle.misc(dynamic conv)
Constructs a instance without preferred units.

Properties

angle180 Angle
Return an equivalent angle bounded to between -PI and PI (-180 and 180 degrees). If this Angle is already within that range then it is returned directly.
no setter
angle360 Angle
Returns an equivalent angle bounded to between 0 and 2PI (0 and 360 degrees). If this Angle is already within that range then it is returned directly.
no setter
arbitraryPrecision bool
Whether or not this Quantity is represented using arbitrary precision.
no setterinherited
cgs Number
Returns the value of this quantity in alternative CGS (or centimeter-gram-second) units. MKS (meter-kilogram-second) units are preferred.
no setterinherited
degMinSec List<double>
Returns an array of three values representing the value of this Angle in degrees, minutes arc and seconds arc. The first value (degrees) may be either positive or negative; the other two values will be positive.
no setter
dimensions Dimensions
Dimensions.
finalinherited
hashCode int
The hash code is based on the value and dimensions. Uncertainty and preferred units are not considered.
no setterinherited
hrMinSec List<double>
Gets the value of this angle in terms of hours, minutes and seconds (where there are 24 hours in a complete circle). The first value (hours) may be either positive or negative; the other two values will be positive.
no setter
isScalar bool
Whether or not this Quantity has scalar dimensions, including having no angle or solid angle dimensions.
no setterinherited
isScalarSI bool
Whether or not this Quantity has scalar dimensions in the strict International System of Units (SI) sense, which allows non-zero angle and solid angle dimensions.
no setterinherited
mks Number
Returns the value of this quantity in standard MKS (or meter-kilogram-second) units.
no setterinherited
preferredUnits Units?
Preferred units for display.
finalinherited
relativeUncertainty double
The relative standard uncertainty in this Quantity object's value.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
standardUncertainty Quantity
Returns the standard uncertainty in this Quantity object's value as a typed Quantity object.
no setterinherited
valueSI Number
The value of the quantity in the base units, of the International System of Units (SI).
finalinherited

Methods

abs() Quantity
Returns the absolute value of this Quantity. If the value of this Quantity is not negative it is returned directly.
inherited
calcExpandedUncertainty(double k) Quantity
Returns the expanded uncertainty for coverage factor, k, in this Quantity's value as a typed Quantity object.
inherited
compareTo(dynamic q2) int
Compares this Quantity to q2 by comparing MKS values. The Quantities need not have the same dimensions.
inherited
cosecant() double
Calculates and returns the cosecant of this angle. The cosecant of an angle is equivalent to 1 over the sine.
cosine() double
Calculates the cosine of this angle.
cotangent() double
Calculates and returns the cotangent of this angle. The cotangent is equivalent to 1 over the tangent.
inverse() Quantity
Determines the inverse of the quantity represented by this object, creating and returning a Quantity object (which may have different dimensions and therefore be of a different type). This object is not modified.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
outputText(StringBuffer buffer, {UncertaintyFormat uncertFormat = UncertaintyFormat.none, bool symbols = true, NumberFormat? numberFormat}) → void
Appends a String representation of this Quantity to the buffer using the preferred units and number format. If no preferred units have been specified, then MKS units are used. Uncertainty in the value of the Quantity is optionally shown as a plus/minus value in the same units.
inherited
randomSample() Quantity
Randomly generates a Quantity from this Quantity's value and uncertainty. The uncertainty is represented by a Normal (Gaussian) continuous distribution.
inherited
secant() double
Calculates and returns the secant of this angle. The secant of an angle is equivalent to 1 over the cosine.
sine() double
Calculates the sine of this angle.
sqrt() Quantity
Returns a Quantity that represents the square root of this Quantity, in terms of both value and dimensions (for example, if this Quantity were an Area of 16 square meters, a Length of 4 meters will be returned).
inherited
tangent() double
Calculates the tangent of this angle.
toJson() Map<String, dynamic>
Support dart:convert stringify.
inherited
toString() String
Returns a String representation of this Quantity using the preferredUnits. If no preferred units have been specified, then MKS units are used.
inherited
valueInUnits(Units? units) Number
Gets the Quantity's value in the specified units. If units is null, the MKS value is returned. If not null, units must have dimensions compatible with this Quantity or a DimensionsException will be thrown.
inherited

Operators

operator *(dynamic multiplier) Quantity
Returns the product of this quantity and multiplier, which is expected to be either a Quantity, num or Number object. All other types will cause a QuantityException to be thrown.
inherited
operator +(dynamic addend) Quantity
Returns the sum of this Quantity and addend.
inherited
operator -(dynamic subtrahend) Quantity
Returns the difference of this Quantity and subtrahend or (this - q2).
inherited
operator /(dynamic divisor) Quantity
Returns the quotient of this quantity and divisor, including both value and dimensions.
inherited
operator <(Quantity other) bool
Determines whether on not this Quantity is less than a specified Quantity by comparing their MKS values. The two Quantities need not be of the same type or dimensions.
inherited
operator <=(Quantity other) bool
Determines whether on not this Quantity is less than or equal to a specified Quantity by comparing their MKS values. The two Quantities need not be of the same type or dimensions.
inherited
operator ==(Object obj) bool
Returns true if this Quantity is equal to obj. Two Quantity objects are considered equal if their MKS values and dimensions are equal. Only values and dimensions are considered; other attributes such as uncertainty and preferred units are ignored.
inherited
operator >(Quantity other) bool
Determines whether on not this Quantity is greater than a specified Quantity by comparing their MKS values. The two Quantities need not be of the same type or dimensions.
inherited
operator >=(Quantity other) bool
Determines whether on not this Quantity is greater than or equal to a specified Quantity by comparing their MKS values. The two Quantities need not be of the same type or dimensions.
inherited
operator ^(dynamic exponent) Quantity
Returns this Quantity raised to the power of exponent.
inherited
operator unary-() Quantity
The unary minus operator returns a Quantity whose value is the negative of this Quantity's value.
inherited

Static Properties

degrees AngleUnits
Accepted for use with the SI.
final
minutes AngleUnits
Accepted for use with the SI; equivalent to minutesArc.
final
minutesArc AngleUnits
Accepted for use with the SI.
final
radians AngleUnits
The standard SI unit.
final
seconds AngleUnits
Accepted for use with the SI; equivalent to secondsArc.
final
secondsArc AngleUnits
Accepted for use with the SI.
final

Constants

angleDimensions → const Dimensions
Dimensions for this type of quantity.