[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
8.3 math
This package extends Asymptote
’s mathematical capabilities with
useful functions such as
void drawline(picture pic=currentpicture, pair P, pair Q, pen p=currentpen);
draw the visible portion of the (infinite) line going through
P
andQ
, without altering the size of picturepic
, using penp
.real intersect(triple P, triple Q, triple n, triple Z);
returns the intersection time of the extension of the line segment
PQ
with the plane perpendicular ton
and passing throughZ
.triple intersectionpoint(triple n0, triple P0, triple n1, triple P1);
Return any point on the intersection of the two planes with normals
n0
andn1
passing through pointsP0
andP1
, respectively. If the planes are parallel, return(infinity,infinity,infinity)
.pair[] quarticroots(real a, real b, real c, real d, real e);
returns the four complex roots of the quartic equation ax^4+bx^3+cx^2+dx+e=0.
pair[][] fft(pair[][] a, int sign=1)
returns the two-dimensional Fourier transform of a using the given
sign
.real time(path g, real x, int n=0)
returns the
n
th intersection time of pathg
with the vertical line through x.real time(path g, explicit pair z, int n=0)
returns the
n
th intersection time of pathg
with the horizontal line through(0,z.y)
.real value(path g, real x, int n=0)
returns the
n
thy
value ofg
atx
.real value(path g, real x, int n=0)
returns the
n
thx
value ofg
aty=z.y
.real slope(path g, real x, int n=0)
returns the
n
th slope ofg
atx
.real slope(path g, explicit pair z, int n=0)
returns the
n
th slope ofg
aty=z.y
.int[][] segment(bool[] b) returns the indices of consecutive true-element segments of bool[]
b
.real[] partialsum(real[] a)
returns the partial sums of a real array
a
.real[] partialsum(real[] a, real[] dx)
returns the partial
dx
-weighted sums of a real arraya
.bool increasing(real[] a, bool strict=false)
returns, if
strict=false
, whetheri > j
impliesa[i] >= a[j]
, or ifstrict=true
, whetheri > j
implies impliesa[i] > a[j]
.int unique(real[] a, real x)
if the sorted array
a
does not containx
, insert it sequentially, returning the index ofx
in the resulting array.bool lexorder(pair a, pair b)
returns the strict lexicographical partial order of
a
andb
.bool lexorder(triple a, triple b)
returns the strict lexicographical partial order of
a
andb
.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on May 24, 2014 using texi2html 5.0.