Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Radians

Represents an angle

example

Create with number

const radians = new Radians(2 * Math.PI);
radians.toString();  // -> '2π rad'
`${radians}`;  // -> '6.283'
+radians;  // -> 6.283
radians.value;  // -> 6.283
example

Create with a radian instance

const previous = new Radians(2 * Math.PI);
const radians = new Radians(previous);
radians.toString();  // -> '2π rad'
example

Convert to degrees

const radians = new Radians(Math.PI);
const degrees = radians.toDegrees();
degrees.toString();  // -> '180°'

Hierarchy

Implements

Index

Constructors

constructor

Properties

max

max: number

min

min: number

Accessors

value

  • get value(): number
  • set value(value: number): void

Methods

__@toPrimitive

  • __@toPrimitive(hint: "string" | "number" | "default"): string | number

__@toStringTag

  • __@toStringTag(): string

get

  • get(): number

set

toDegrees

  • toDegrees(): number
  • Converts the radians into degrees

    Returns number

    the converted degrees value

toJSON

  • toJSON(_?: string): any | number | string | boolean | null
  • Converts the primitive into it's JSON representation

    Parameters

    • Default value _: string = ""

    Returns any | number | string | boolean | null

    the object to serialize with JSON.stringify

toString

  • toString(): string

valueOf

  • valueOf(): number