Skip to content

Num.Radians

Num / Radians

Import

typescript
import { Num } from '@wollybeard/kit'

// Access via namespace
Num.Radians.someFunction()
typescript
import * as Num from '@wollybeard/kit/num'

// Access via namespace
Num.Radians.someFunction()

Functions

[F] is

typescript
(value: unknown): boolean

Type predicate to check if value is a valid radian angle. Note: Any finite number can represent an angle in radians.

[F] from

typescript
(value: number): number & { [RadiansBrand]: true; } & { [FiniteBrand]: true; }

Construct a Radians angle. Throws if the value is not finite.

[F] tryFrom

typescript
(value: number): (number & { [RadiansBrand]: true; } & { [FiniteBrand]: true; }) | null

Try to construct a Radians angle. Returns null if the value is not finite.

[F] fromDegrees

typescript
(degrees: number): number & { [RadiansBrand]: true; } & { [FiniteBrand]: true; }

Convert degrees to radians.

[F] toDegrees

typescript
(rad: Radians): number

Convert radians to degrees.

[F] normalize

typescript
(rad: Radians): number & { [RadiansBrand]: true; } & { [FiniteBrand]: true; }

Normalize radians to the range [0, 2π).

Types

[∩] Radians

typescript
type Radians = number & { [RadiansBrand]: true }

Angle in radians.