Type module
Sources
Items from Math can be imported/included and used via following ways.
/** * -------------------------------------------------------- * Import via main package: core.ts * Access items like: am5.math.myVariable * am5.math.myFunction() * -------------------------------------------------------- */ import * as am5 from "@amcharts/amcharts5"; /** * -------------------------------------------------------- * Import via: Math.ts * Access items like: $math.myVariable * $math.myFunction() * -------------------------------------------------------- */ import * as $math from "@amcharts/amcharts5/Math";
/** * -------------------------------------------------------- * Include via "index.js" * E.g.: "https://cdn.amcharts.com/lib/5/index.js" * Access items like: am5.math.myVariable * am5.math.myFunction() * -------------------------------------------------------- */
Variables
RADIANS # |
Type Default |
---|---|
HALFPI # |
Type Default |
DEGREES # |
Type Default |
Functions
boundsOverlap( bounds1: ) |
Returns Returns true if bounds overlap |
---|---|
ceil( value: ) |
Returns Ceils the numeric value to whole number or specific precision of set. |
circlesOverlap( circle1: { radius: ) |
Returns Returns true if circles overlap |
closest( values: ) |
Returns Returns the closest value from the array of values to the reference value. |
cos( angle: ) |
Returns Returns cosine of an angle specified in degrees. |
fitAngleToRange( value: ) |
Returns |
fitToRange( value: ) |
Returns |
getAngle( point1: ) |
Returns |
getArcBounds( cx: ) |
Returns |
getArcPoint( radius: ) |
Returns { x: Returns point on arc |
getPointOnLine( pointA: ) |
Returns |
inBounds( ) |
Returns |
mergeBounds( bounds: ) |
Returns |
normalizeAngle( value: ) |
Returns |
round( value: ) |
Returns "Rounds" the date to specific time unit. |
sin( angle: ) |
Returns Returns sine of an angle specified in degrees. |
spiralPoints( cx: ) |
Returns Generates points of a spiral |
tan( angle: ) |
Returns Returns tan of an angle specified in degrees. |