angle_utils

Last updated:

0 purchases

angle_utils Image
angle_utils Images
Add to Cart

Description:

angle utils

Angle utils #
A small and compact utility library for dealing with all kinds of angles. This library supports radians, degrees, turns and gradians.
Angle #
var angle = Angle.degrees(90);
angle.radians; // pi/2
angle.degrees; // 90
angle.gradians; // 100
angle.turns; // 1/4

var full = Angle.full();
full.radians; // 2*pi
full.degrees; // 360
full.gradians; // 400
full.turns; // 1

var diff = full - angle;
diff.degrees; // 270

var other = Angle.degrees(-10);
other.normalized.degrees; // 350
copied to clipboard
AngleRange #
This library also provides an AngleRange type:
var range = AngleRange(start: Angle.degrees(80), end: Angle.degrees(100));
range.start; // Angle.degrees(80)
range.end; // Angle.degrees(100)
range.mid; // Angle.degrees(90)
range.sweep; // Angle.degrees(20)

range.includes(Angle.degrees(90)); // true
range.includes(Angle.degrees(70)); // false
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.