Skip to content

Commit

Permalink
Add derived elliptic functions
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmasson committed Jan 24, 2025
1 parent 41e341a commit a92e977
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
19 changes: 19 additions & 0 deletions build/math.js
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,25 @@ function am( x, m ) {

}

function ns( x, m ) { return inv( sn(x,m) ); }

function nc( x, m ) { return inv( cn(x,m) ); }

function nd( x, m ) { return inv( dn(x,m) ); }

function sc( x, m ) { return div( sn(x,m), cn(x,m) ); }

function cs( x, m ) { return div( cn(x,m), sn(x,m) ); }

function sd( x, m ) { return div( sn(x,m), dn(x,m) ); }

function ds( x, m ) { return div( dn(x,m), sn(x,m) ); }

function cd( x, m ) { return div( cn(x,m), dn(x,m) ); }

function dc( x, m ) { return div( dn(x,m), cn(x,m) ); }



function weierstrassRoots( g2, g3 ) {

Expand Down
18 changes: 18 additions & 0 deletions docs/functions.html
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,24 @@ <h1>Elliptic Functions</h1>

<p><a href="functions/dn.html"><b>dn( <i>x</i>, <i>m</i> )</b></a> &mdash; Jacobi delta amplitude of a real or complex number with real or complex elliptic parameter&nbsp;<i>m</i></p>

<p><b>ns( <i>x</i>, <i>m</i> )</b> &mdash; inverse of Jacobi elliptic sine of a real or complex number with real or complex elliptic parameter <i>m</i></p>

<p><b>nc( <i>x</i>, <i>m</i> )</b> &mdash; inverse of Jacobi elliptic cosine of a real or complex number with real or complex elliptic parameter <i>m</i></p>

<p><b>nd( <i>x</i>, <i>m</i> )</b> &mdash; inverse of Jacobi elliptic delta amplitude of a real or complex number with real or complex elliptic parameter <i>m</i></p>

<p><b>sc( <i>x</i>, <i>m</i> )</b> &mdash; ratio of Jacobi elliptic sine and cosine of a real or complex number with real or complex elliptic parameter <i>m</i></p>

<p><b>cs( <i>x</i>, <i>m</i> )</b> &mdash; ratio of Jacobi elliptic cosine and sine of a real or complex number with real or complex elliptic parameter <i>m</i></p>

<p><b>sd( <i>x</i>, <i>m</i> )</b> &mdash; ratio of Jacobi elliptic sine and delta amplitude of a real or complex number with real or complex elliptic parameter <i>m</i></p>

<p><b>ds( <i>x</i>, <i>m</i> )</b> &mdash; ratio of Jacobi elliptic delta amplitude and sine of a real or complex number with real or complex elliptic parameter <i>m</i></p>

<p><b>cd( <i>x</i>, <i>m</i> )</b> &mdash; ratio of Jacobi elliptic cosine and delta amplitude of a real or complex number with real or complex elliptic parameter <i>m</i></p>

<p><b>dc( <i>x</i>, <i>m</i> )</b> &mdash; ratio of Jacobi elliptic delta amplitude and cosine of a real or complex number with real or complex elliptic parameter <i>m</i></p>

<p><b>weierstrassRoots( <i>g</i><sub>2</sub>, <i>g</i><sub>3</sub> )</b> &mdash; Weierstrass roots <i>e</i><sub>1</sub>, <i>e</i><sub>2</sub> and <i>e</i><sub>3</sub> for real or complex invariants. Returned as an array.</p>

<p><b>weierstrassHalfPeriods( <i>g</i><sub>2</sub>, <i>g</i><sub>3</sub> )</b> &mdash; Weierstrass half periods <i>w</i><sub>1</sub> and <i>w</i><sub>2</sub> for real or complex invariants. Returned as an array. Consistent with evaluation of Weierstrass elliptic function in terms of Jacobi elliptic sine.</p>
Expand Down
19 changes: 19 additions & 0 deletions src/functions/elliptic-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,25 @@ function am( x, m ) {

}

function ns( x, m ) { return inv( sn(x,m) ); }

function nc( x, m ) { return inv( cn(x,m) ); }

function nd( x, m ) { return inv( dn(x,m) ); }

function sc( x, m ) { return div( sn(x,m), cn(x,m) ); }

function cs( x, m ) { return div( cn(x,m), sn(x,m) ); }

function sd( x, m ) { return div( sn(x,m), dn(x,m) ); }

function ds( x, m ) { return div( dn(x,m), sn(x,m) ); }

function cd( x, m ) { return div( cn(x,m), dn(x,m) ); }

function dc( x, m ) { return div( dn(x,m), cn(x,m) ); }



function weierstrassRoots( g2, g3 ) {

Expand Down

0 comments on commit a92e977

Please sign in to comment.