Home Reference Source

Variable

Static Public Summary
public

ANGLE_STYLE: {"DEG": number, "RAD": number}

Defines if the angle used is in radians or degrees.

public

Avogadro constant.

public

Boltzmann constant.

public

BOX_COLORS: {"BLUE": *, "GREEN": *, "RED": *, "YELLOW": *, "ORANGE": *, "PURPLE": *, "GRAY": *}

Defines the default colors used for box displays.

public

Conversion factor from cubic centimeters to cubic meters.

public

Conversion factor from centimeters to meters.

public

COLORS: {"RED": string, "BLUE": string, "GREEN": string, "YELLOW": string, "PURPLE": string, "BROWN": string, "LIGHT_GREEN": string, "GRAY": string, "LIGHT_GRAY": string, "WHITE": string, "BLACK": string, "COMPONENT": string}

Defines the default colors used for simulations.

public

Cosine of 30°.

public

Cosine of 60°.

public

CURSOR: {"DEFAULT": string, "POINTER": string, "CROSS": string, "MOVE": string, "TEXT": string}

Types of cursors that an object can have when hovered or dragged.

public

Conversion factor from degrees to radians.

public

Used when the mouse isn't dragging an object.

public

Vacuum permittivity constant.

public

PI / 5 constant.

public

Defines the default font used for all simulations.

public

Defines teh valid font alignments.

public

Defines the valid font baselines.

public

Defines the default font color for all simulaions.

public

s Defines the default font size for all simulations.

public

PI / 4 constant.

public

Graviy constant.

public

PI / 2 constant.

public

Coulomb's constant.

public

Log 10 constant.

public

MOVE_STYLE: {"BY_PX": string, "BY_UNITS": string}

Defines how the coordinates of an object will be changed when the object is dragged around.

public

Conversion factor from meters to centimeters.

public

Used when the mouse isn't over an object.

public

Conversion factor from pascals to atmospheres.

public

PI constant.

public

Conversion factor from radians to degrees.

public

SHAPE_STYLE: {"NONE": *, "ACCOMULATIVE": number}

Defines how a shape is drawn with the methods Shape.moveTo and Shape.lineTo.

public

Sine of 30°.

public

Sine of 60°.

public

PI / 6 constant.

public

SYMBOL: {"BLANK": string, "THETA": string, "INF": string, "MICRO": string, "OHM": string, "LETTERS": string}

Useful symbols for simulations.

public

PI / 3 constant.

public

2 * PI constant.

Static Public

public ANGLE_STYLE: {"DEG": number, "RAD": number} source

import {ANGLE_STYLE} from 'newton-lib/src/utils/Constants.js'

Defines if the angle used is in radians or degrees.

Properties:

NameTypeAttributeDescription
DEG number
  • default: 1

Angle is in degrees.

RAD number
  • default: 2

Angle is in radians.

public AVOGADRO: number source

import {AVOGADRO} from 'newton-lib/src/utils/Constants.js'

Avogadro constant.

See:

public BOLTZMANN: number source

import {BOLTZMANN} from 'newton-lib/src/utils/Constants.js'

Boltzmann constant.

See:

public BOX_COLORS: {"BLUE": *, "GREEN": *, "RED": *, "YELLOW": *, "ORANGE": *, "PURPLE": *, "GRAY": *} source

import {BOX_COLORS} from 'newton-lib/src/utils/Constants.js'

Defines the default colors used for box displays. Colors are provided in matching pairs of BACKGROUND and BORDER colors.

public CM3_TO_M3: number source

import {CM3_TO_M3} from 'newton-lib/src/utils/Constants.js'

Conversion factor from cubic centimeters to cubic meters.

public CM_TO_M: number source

import {CM_TO_M} from 'newton-lib/src/utils/Constants.js'

Conversion factor from centimeters to meters.

public COLORS: {"RED": string, "BLUE": string, "GREEN": string, "YELLOW": string, "PURPLE": string, "BROWN": string, "LIGHT_GREEN": string, "GRAY": string, "LIGHT_GRAY": string, "WHITE": string, "BLACK": string, "COMPONENT": string} source

import {COLORS} from 'newton-lib/src/utils/Constants.js'

Defines the default colors used for simulations.

public COS30: number source

import {COS30} from 'newton-lib/src/utils/Constants.js'

Cosine of 30°.

public COS60: number source

import {COS60} from 'newton-lib/src/utils/Constants.js'

Cosine of 60°.

public CURSOR: {"DEFAULT": string, "POINTER": string, "CROSS": string, "MOVE": string, "TEXT": string} source

import {CURSOR} from 'newton-lib/src/utils/Constants.js'

Types of cursors that an object can have when hovered or dragged.

Properties:

NameTypeAttributeDescription
DEFAULT string
  • default: "default"
POINTER string
  • default: "pointer"
CROSS string
  • default: "cross"
MOVE string
  • default: "move"
TEXT string
  • default: "text"

public DEG_TO_RAD: number source

import {DEG_TO_RAD} from 'newton-lib/src/utils/Constants.js'

Conversion factor from degrees to radians.

public DRAG_NOTHING: null source

import {DRAG_NOTHING} from 'newton-lib/src/utils/Constants.js'

Used when the mouse isn't dragging an object.

public E0: number source

Vacuum permittivity constant.

See:

public FIFTH_PI: number source

import {FIFTH_PI} from 'newton-lib/src/utils/Constants.js'

PI / 5 constant.

public FONT: string source

Defines the default font used for all simulations.

public FONT_ALIGN: string[] source

import {FONT_ALIGN} from 'newton-lib/src/utils/Constants.js'

Defines teh valid font alignments.

public FONT_BASELINE: string[] source

import {FONT_BASELINE} from 'newton-lib/src/utils/Constants.js'

Defines the valid font baselines.

public FONT_COLOR: string source

import {FONT_COLOR} from 'newton-lib/src/utils/Constants.js'

Defines the default font color for all simulaions.

public FONT_SIZE: string source

import {FONT_SIZE} from 'newton-lib/src/utils/Constants.js'

s Defines the default font size for all simulations.

public FOURTH_PI: number source

import {FOURTH_PI} from 'newton-lib/src/utils/Constants.js'

PI / 4 constant.

public GRAVITY: number source

import {GRAVITY} from 'newton-lib/src/utils/Constants.js'

Graviy constant.

public HALF_PI: number source

import {HALF_PI} from 'newton-lib/src/utils/Constants.js'

PI / 2 constant.

public LOG10: number source

import {LOG10} from 'newton-lib/src/utils/Constants.js'

Log 10 constant.

public MOVE_STYLE: {"BY_PX": string, "BY_UNITS": string} source

import {MOVE_STYLE} from 'newton-lib/src/utils/Constants.js'

Defines how the coordinates of an object will be changed when the object is dragged around.

Properties:

NameTypeAttributeDescription
BY_PX string
  • default: "px"

The position of the object will be changed in pixels.

BY_UNITS string
  • default: "units"

The position of the object will be changed in units.

public M_TO_CM: number source

import {M_TO_CM} from 'newton-lib/src/utils/Constants.js'

Conversion factor from meters to centimeters.

public OVER_NOTHING: number source

import {OVER_NOTHING} from 'newton-lib/src/utils/Constants.js'

Used when the mouse isn't over an object.

public PA_TO_ATM: number source

import {PA_TO_ATM} from 'newton-lib/src/utils/Constants.js'

Conversion factor from pascals to atmospheres.

public PI: number source

PI constant.

public RAD_TO_DEG: number source

import {RAD_TO_DEG} from 'newton-lib/src/utils/Constants.js'

Conversion factor from radians to degrees.

public SHAPE_STYLE: {"NONE": *, "ACCOMULATIVE": number} source

import {SHAPE_STYLE} from 'newton-lib/src/utils/Constants.js'

Defines how a shape is drawn with the methods Shape.moveTo and Shape.lineTo.

Properties:

NameTypeAttributeDescription
NONE number
  • default: 0

Every time a set of coordinates is provided they will be used as absolute coordinates.

ACCOMULATIVE number
  • default: 1

The next set of coordinates will be used relative to the previous set of coordinates.

public SIN30: number source

import {SIN30} from 'newton-lib/src/utils/Constants.js'

Sine of 30°.

public SIN60: number source

import {SIN60} from 'newton-lib/src/utils/Constants.js'

Sine of 60°.

public SIXTH_PI: number source

import {SIXTH_PI} from 'newton-lib/src/utils/Constants.js'

PI / 6 constant.

public SYMBOL: {"BLANK": string, "THETA": string, "INF": string, "MICRO": string, "OHM": string, "LETTERS": string} source

import {SYMBOL} from 'newton-lib/src/utils/Constants.js'

Useful symbols for simulations. The unicode of every symbol is used.

Properties:

NameTypeAttributeDescription
BLANK string
  • default: -

Used for labels when no value is provided.

THETA string
  • default: "θ"
INF string
  • default: "\u221e"
MICRO string
  • default: "\u03BC"
OHM string
  • default: "\u2126"
LETTERS string
  • default: "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

public THIRD_PI: number source

import {THIRD_PI} from 'newton-lib/src/utils/Constants.js'

PI / 3 constant.

public TWO_PI: number source

import {TWO_PI} from 'newton-lib/src/utils/Constants.js'

2 * PI constant.