pygeomath
bring mathematical functions from the Numeric and cvisual modles into the PyGeo namespace,
and create convenience functions and classes for analytical operations
Functions
array(sequence, typecode=None, copy=1, savespace=0) will return a new array formed from the given (potentially nested) sequence with type given by typecode. If no typecode is given, then the type will be determined as the minimum type required to hold the objects in sequence. If copy is zero and sequence is already an array, a reference will be returned. If savespace is nonzero, the new array will maintain its precision in operations.
reshape(a, (d1, d2, ..., dn)). Change the shape of a to be an n-dimensional array with dimensions given by d1...dn. Note: the size specified for the new array must be exactly equal to the size of the old one or an error will occur.
The cross product between two vectors.
arange(start, stop=None, step=1, typecode=None)
Just like range() except it returns an array whose type can be
specified by the keyword argument typecode.
return a 3 element array representing the origin centered projection
of the given point to the plane parallel with the XY plane at unit distance
the return the roots of the quadratic equation with
the three given values as coefficients - i.e. a*x**2 + b&x +c
return the crossproduct of the vectors connecting the 1st given
position with that of the 2nd and 3rd given positions
return a 4 element array as a homogenous coordinate of the given
3 element vector
return the crossratio of 4 ordered points
f
asarray(a, typecode=None, savespace=0)
...
asarray(a,typecode=None) returns a as a NumPy array. Unlike array(),
no copy is performed if a is already an array.
return the modulus (absolute value) of the given complex number
return the square of the modulus of the given complex number
eigenvectors(a) returns u,v where u is the eigenvalues and
v is a matrix of eigenvectors with vector v[i] corresponds to
eigenvalue u[i]. Satisfies the equation dot(a, v[i]) = u[i]*v[i]
transpose(a, axes=None) returns array with dimensions permuted
according to axes. If axes is None (default) returns array with
dimensions reversed.
dot(a,b) returns matrix-multiplication between a and b. The product-sum
is over the last dimension of a and the second-to-last dimension of b.
dot(a,b) returns matrix-multiplication between a and b. The product-sum
is over the last dimension of a and the second-to-last dimension of b.
f
trace(a, offset=0, axis1=0, axis2=1)
...
trace(a,offset=0, axis1=0, axis2=1) returns the sum along diagonals
(defined by the last two dimenions) of the array.
f
ones(shape, typecode='l', savespace=0)
...
ones(shape, typecode=Int, savespace=0) returns an array of the given
dimensions which is initialized to all ones.
identity(n) returns the identity matrix of shape n x n.
Get the shape of sequence a
Classes
the Hermitian matrix [[A,B],[C,D]]
the complex valued Mobius transformation matrix [[a,b],[c,d]]
Attributes
'http://source.net/projects/pygeo'
See
the source
for more information.