Functions | Variables
math_util Namespace Reference

Functions

def ang_of_vec
def approx_equal
def approx_equalv
def argmax2d
 NUMPY HELPER FUNCTIONS.
def avg_ang
def best_turn_dir
def blend
 MISCELLANEOUS MATH HELPER FUNCTIONS.
def blend_ang
def bound
 Bound the value of a number to be above lower, and lower than upper.
def bound_mat
def cart_of_pol
def degrees
def homo_to_point
def list_mat_to_mat
def list_of_mat
def nearest
def norm
def point_to_homo
def pol_of_cart
def radians
def renormalize
 Changes the range of an numpy array to betwen [0, 255] from it's [min_value, max_value].
def rnd
def standard_rad
def vec_of_ang
 Angles related functions.

Variables

 diff_vec = mat-target
tuple dist = np.power(np.sum(np.power(diff_vec, pwr),axis=0),0.5)
tuple indices = np.concatenate((np.matrix(range(sort_order.shape[1])), sort_order), 0)
tuple mat = ut.load_pickle('mat.pkl')
tuple pwr = np.ones_like(mat[0])
tuple sort_order = dist.argsort(axis=1)
tuple target = ut.load_pickle('target.pkl')

Function Documentation

def math_util.ang_of_vec (   a)

Definition at line 50 of file cap_360/math_util.py.

def math_util::approx_equal (   a,
  b,
  epsilon = .001 
)

Definition at line 32 of file cap_360/math_util.py.

def math_util.approx_equalv (   a,
  b,
  epsilon = .001 
)

Definition at line 35 of file cap_360/math_util.py.

def math_util.argmax2d (   mat)

NUMPY HELPER FUNCTIONS.

Find the maximal position in a 2D array

Returns:
(r,c)

Definition at line 98 of file cap_360/math_util.py.

def math_util.avg_ang (   wa,
  a,
  wb,
  b 
)
     Calculates the average between two angles
     wa  weight of first angle
     a   first angle
     wb  weight of second angle
     b   second angle

Definition at line 54 of file cap_360/math_util.py.

def math_util.best_turn_dir (   reference,
  new_angle 
)
positive is left, negative is right! 

Definition at line 73 of file cap_360/math_util.py.

def math_util.blend (   alpha,
  a,
  b 
)

MISCELLANEOUS MATH HELPER FUNCTIONS.

Definition at line 182 of file cap_360/math_util.py.

def math_util.blend_ang (   alpha,
  a,
  b 
)

Definition at line 64 of file cap_360/math_util.py.

def math_util.bound (   value,
  lower,
  upper 
)

Bound the value of a number to be above lower, and lower than upper.

Returns:
a number

Definition at line 10 of file cap_360/math_util.py.

def math_util.bound_mat (   m,
  lower,
  upper 
)

Definition at line 21 of file cap_360/math_util.py.

def math_util.cart_of_pol (   p)
Finds cartesian coordinates of polar points [r, t]' 

Definition at line 77 of file cap_360/math_util.py.

def math_util.degrees (   mat)

Definition at line 41 of file cap_360/math_util.py.

Definition at line 203 of file cap_360/math_util.py.

def math_util.list_mat_to_mat (   list_mat,
  axis = 0 
)

Definition at line 113 of file cap_360/math_util.py.

def math_util.list_of_mat (   mat)

Definition at line 116 of file cap_360/math_util.py.

def math_util.nearest (   mat,
  target 
)
    Return a sorted list of the nearest (euclidean dist) element
    of a matrix to a target value and their indeices.
    @param mat    mxn
    @param target mx1

Definition at line 120 of file cap_360/math_util.py.

def math_util.norm (   mat)
    Calculate L2 norm for column vectors in a matrix

Definition at line 188 of file cap_360/math_util.py.

Convert points into homogeneous coordinates 

Definition at line 197 of file cap_360/math_util.py.

def math_util.pol_of_cart (   p)
Find polar coordinates of cartesian points [x, y]' 

Definition at line 85 of file cap_360/math_util.py.

def math_util.radians (   mat)

Definition at line 38 of file cap_360/math_util.py.

def math_util.renormalize (   npimage_gray)

Changes the range of an numpy array to betwen [0, 255] from it's [min_value, max_value].

Definition at line 107 of file cap_360/math_util.py.

def math_util.rnd (   v)

Definition at line 194 of file cap_360/math_util.py.

Definition at line 67 of file cap_360/math_util.py.

def math_util.vec_of_ang (   a)

Angles related functions.

Definition at line 47 of file cap_360/math_util.py.


Variable Documentation

Definition at line 153 of file cap_360/math_util.py.

tuple math_util::dist = np.power(np.sum(np.power(diff_vec, pwr),axis=0),0.5)

Definition at line 155 of file cap_360/math_util.py.

tuple math_util::indices = np.concatenate((np.matrix(range(sort_order.shape[1])), sort_order), 0)

Definition at line 159 of file cap_360/math_util.py.

Definition at line 150 of file cap_360/math_util.py.

tuple math_util::pwr = np.ones_like(mat[0])

Definition at line 154 of file cap_360/math_util.py.

tuple math_util::sort_order = dist.argsort(axis=1)

Definition at line 156 of file cap_360/math_util.py.

Definition at line 151 of file cap_360/math_util.py.



rfid_datacapture
Author(s): Travis Deyle
autogenerated on Wed Nov 27 2013 12:11:16