manpagez: man pages & more
info asymptote
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.3 math

This package extends Asymptote's mathematical capabilities with intersection algorithms and matrix arithmetic.

Unlike MetaPost, Asymptote does not implicitly solve linear equations and therefore does not have the notion of a whatever unknown. Use the built-in explicit linear equation solver solve instead. The following routine provides a useful replacement for a common use of whatever: finding the intersection point of the lines through P, Q and p, q, respectively:

pair extension(pair P, pair Q, pair p, pair q);

Here are some additional routines provided in the math package:

void drawline(picture pic=currentpicture, pair P, pair Q, pen p=currentpen);

draw the visible portion of the (infinite) line going through P and Q, without altering the size of picture pic, using pen p.

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 to n and passing through Z.

triple intersectionpoint(triple n0, triple P0, triple n1, triple P1);

Return any point on the intersection of the two planes with normals n0 and n1 passing through points P0 and P1, 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.


© manpagez.com 2000-2024
Individual documents may contain additional copyright information.