dart-angles
각도용 단위 래퍼입니다.
- 스타
- 7
- 포크
- 2
- 최근 푸시(UTC)
- 2023. 11. 4.
- 프로젝트 상태
- 활성
원본 README
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
Dart Angles
This package provides an Angle type seeking to eliminate the use of variable suffixes like ...deg or ...rad
as well as manual angle unit conversions such as x * rad2deg and the likes.
Therefore, this package's raison d'être is not to serve features but to increase code maintainability, thus reducing maintaince cost and bugs.
Angles can be constructed from these units: degrees, radians, gradians and turns.
| Unit | Quantity of a full turn |
|---|---|
| Degree | 360° |
| Radian | 2π |
| Gradian | 400ᵍ |
| Turn | 1 |
Sample code
// Various ways to define a half turn:
a0 = Angle.degrees(180.0);
a1 = Angle.radians(math.pi);
a2 = Angle.turns(0.5);
a0.degrees; // = 180.0
a1.radians; // = 3.1415...
a2.turns; // = 0.5
Documentation
Constructors:
Angle.degrees(x)Angle.radians(x)Angle.gradians(x)Angle.turns(x)
Accessors:
.degrees().radians().gradians().turns()
Trigonometric functions:
.sin().cos().tan()Angle.asin(x)Angle.acos(x)Angle.atan(x)Angle.atan2(y, x)Angle.atanFullTurn(y, x)Angle.cartesian(x, y)
Utility functions:
.toString().approximately(other, range).ratio(other).normalized
All arithmetic and relational operators are defined on angles as well.
언어Dart
사용 중인 의존성
프로젝트에 맞는 저장소를 선택하려면?
사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.
- 이름, 작성자 또는 설명으로 검색하고 기술 주제로 범위를 좁힙니다.
- 스타, 포크, 최근 푸시를 함께 비교하세요. 스타는 관심의 지표이며 품질을 보장하지 않습니다.
- 사용하기 전에 GitHub에서 README, 라이선스, Issues를 확인하세요.
출처 및 관리
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗