http://wiki.noordover.org, un wiki dont l'objectif est modeste : permettre d'écrire facilement, en vrac, à un rythme de sénateur, quelques trucs et astuces divers, pour ne pas les oublier et aider éventuellement d'autres personnes.

UN COPIER-COLLER (temporaire car je vais tout reprendre quand j'aurai le temps !) D'UN BOUT DE LA DOC OFFICIELLE :

Asymptote supports the following data types (in addition to user-defined types):

type descriptif
void The void type is used only by functions that take or return no arguments.
bool a boolean type that can only take on the values true and false. For example:
bool b=true;

defines a boolean variable b and initializes it to the value true. If no initializer is given:

bool b;

the value false is assumed.

int an integer type; if no initializer is given, the implicit value 0 is assumed.
The minimum allowed value of an integer is intMin and the maximum value is intMax.
real a real number; this should be set to the highest-precision native floating-point type on the architecture.
The implicit initializer for reals is 0.0. Real numbers have precision realEpsilon, with realDigits significant digits.
The smallest positive real number is realMin and the largest positive real number is realMax.
pair complex number, that is, an ordered pair of real components (x,y).
The real and imaginary parts of a pair z can read as z.x and z.y.
We say that x and y are virtual members of the data element pair; they cannot be directly modified, however.
The implicit initializer for pairs is (0.0,0.0). There are a number of ways to take the complex conjugate of a pair:
pair z=(3,4);
z=(z.x,-z.y);
z=z.x-I*z.y;
z=conj(z);

Here I is the pair (0,1). A number of built-in functions are defined for pairs:

pair conj(pair z)

returns the conjugate of z;

real length(pair z)

returns the complex modulus |z| of its argument z. For example,

pair z=(3,4);
length(z);

returns the result 5. A synonym for length(pair) is abs(pair);

real angle(pair z)

returns the angle of z in radians in the interval [-pi,pi];

real degrees(pair z, bool warn=true)

returns the angle of z in degrees in the interval [0,360) or 0 if warn is false and z.x=z.y=0 (rather than producing an error);

pair unit(pair z)

returns a unit vector in the direction of the pair z;

pair expi(real angle)

returns a unit vector in the direction angle measured in radians;

pair dir(real angle)

returns a unit vector in the direction angle measured in degrees;

real xpart(pair z)

returns z.x;

real ypart(pair z)

returns z.y;

pair realmult(pair z, pair w)

returns the element-by-element product (z.x*w.x,z.y*w.y);

real dot(pair z, pair w)

returns the dot product z.x*w.x+z.y*w.y;

pair minbound(pair z, pair w)

returns (min(z.x,w.x),min(z.y,w.y));

pair maxbound(pair z, pair w)

returns (max(z.x,w.x),max(z.y,w.y)).

triple an ordered triple of real components (x,y,z) used for three-dimensional drawings.
The respective components of a triple v can read as v.x, v.y, and v.z.
The implicit initializer for triples is (0.0,0.0,0.0).
Here are the built-in functions for triples :
real length(triple v)

returns the length |v| of the vector v. A synonym for length(triple) is abs(triple);

real polar(triple v)

returns the colatitude of v measured from the z axis in radians;

real azimuth(triple v)

returns the longitude of v measured from the x axis in radians;

real colatitude(triple v)

returns the colatitude of v measured from the z axis in degrees;

real latitude(triple v)

returns the latitude of v measured from the xy plane in degrees;

real longitude(triple v, bool warn=true)

returns the longitude of v measured from the x axis in degrees; or 0 if warn is false and v.x=v.y=0 (rather than producing an error);

triple unit(triple v)

returns a unit triple in the direction of the triple v;

triple expi(real colatitude, real longitude)

returns a unit triple in the direction (colatitude,longitude) measured in radians;

triple dir(real colatitude, real longitude)

returns a unit triple in the direction (colatitude,longitude) measured in degrees;

real xpart(triple v)

returns v.x;

real ypart(triple v)

returns v.y;

real zpart(triple v)

returns v.z;

real dot(triple u, triple v)

returns the dot product u.x*v.x+u.y*v.y+u.z*v.z;

triple cross(triple u, triple v)

returns the cross product (u.y*v.z-u.z*v.y,u.z*v.x-u.x*v.z,u.x*v.y-v.x*u.y);

triple minbound(triple u, triple v)

returns (min(u.x,v.x),min(u.y,v.y),min(u.z,v.z));

triple maxbound(triple u, triple v)

returns (max(u.x,v.x),max(u.y,v.y),max(u.z,v.z)).

string a character string, implemented using the STL string class.

Outils personnels