Package geometry :: Module basic_utils
[hide private]
[frames] | no frames]

Module basic_utils

source code

Functions [hide private]
 
deprecated(func)
This is a decorator which can be used to mark functions as deprecated.
source code
 
finite(x)
:param x: :type x: ``array``
source code
 
normalize_length(s, norm=2)
Normalize an array such that it has unit length in the given norm.
source code
 
normalize_length_or_zero(s, norm=2)
Normalize an array such that it has unit length in the given norm; if the norm is close to zero, the zero vector is returned.
source code
 
safe_arccos(x)
Returns the arcosine of x, clipped between -1 and 1.
source code
Variables [hide private]
  __package__ = 'geometry'
Function Details [hide private]

deprecated(func)

source code 

This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emitted when the function is used.

normalize_length(s, norm=2)

source code 

Normalize an array such that it has unit length in the given norm.

:param s: :type s: ``array``

normalize_length_or_zero(s, norm=2)

source code 

       Normalize an array such that it has unit length in the given norm; 
       if the norm is close to zero, the zero vector is returned.     
   


:param s: 
:type s:  ``array``

safe_arccos(x)

source code 

Returns the arcosine of x, clipped between -1 and 1.

Use this when you know x is a cosine, but it might be slightly over 1 or below -1 due to numerical errors.