The ePiX function P turns a pair of doubles into a
<pair>
(an ordered pair data structure). ePiX treats pairs as
complex numbers for arithmetic purposes; standard C-like
constructions may be used with pairs.
polar(r, theta); cis(t);
polar(1.0, t), cis(t), and P(cos(t),sin(t)) are
equivalent. ePiX recognizes the standard basis e_1
and
e_2
.
p + q, p - q, k*p, p*q, p/q; p += q, p -= q, p *= k, p *= q; p /= q;
When forming symbolic expressions involving pairs, scalars (doubles) must be collected together at left, vectors (pairs) at right. If results of an arithmetic expression are unexpected, use parentheses to force a particular association.
ePiX provides the Euclidean dot product (think of Dirac's bra-ket notation), the componentwise product, and a 1/4-turn counterclockwise:
(a,b)|(x,y) = ax+by (a,b)&(x,y) = (ax,by) J(a,b) = (-b,a)For example,
P(a,b)&e_2 = P(0,b)
.