svg-getpointatlength
Version:
alternative to native pointAtLength() and getTotalLength() method
24 lines (17 loc) • 1.51 kB
JavaScript
export const {
abs, acos, asin, atan, atan2, ceil, cos, exp, floor,
log, hypot, max, min, pow, random, round, sin, sqrt, tan, PI
} = Math;
// Legendre Gauss weight and abscissa values
export const lgVals = {}
/*
export const lgVals = {
'wa24': [[0.12793819534675224,-0.06405689286260563],[0.12793819534675224,0.06405689286260563],[0.12583745634682839,-0.1911188674736163],[0.12583745634682839,0.1911188674736163],[0.12167047292780335,-0.3150426796961634],[0.12167047292780335,0.3150426796961634],[0.11550566805372561,-0.4337935076260452],[0.11550566805372561,0.4337935076260452],[0.10744427011596562,-0.5454214713888396],[0.10744427011596562,0.5454214713888396],[0.09761865210411368,-0.6480936519369755],[0.09761865210411368,0.6480936519369755],[0.08619016153195208,-0.7401241915785544],[0.08619016153195208,0.7401241915785544],[0.07334648141108027,-0.820001985973903],[0.07334648141108027,0.820001985973903],[0.05929858491543666,-0.8864155270044011],[0.05929858491543666,0.8864155270044011],[0.044277438817419676,-0.9382745520027328],[0.044277438817419676,0.9382745520027328],[0.028531388628933813,-0.9747285559713095],[0.028531388628933813,0.9747285559713095],[0.012341229799985648,-0.9951872199970213],[0.012341229799985648,0.9951872199970213]]
}
*/
export const PI2 = Math.PI * 2;
export const PI_half = Math.PI * 0.5;
//let deg2rad = Math.PI / 180;
export const deg2rad = 0.017453292519943295;
//let rad2deg = 180/Math.PI;
export const rad2deg = 57.29577951308232;