packages/pyglGA/ECSS/utilities.py
def normalise(vector):
    """standard vector normalization over any numpy array

    :param vector: iterable vector to normalise
    :type vector: numpy array
    """
    #norm = math.sqrt(vector*vector)
    if isinstance(vector, np.ndarray)==False:
        vector = vec(vector)
    norm = np.linalg.norm(vector,2) #equivalent to norm = np.sqrt(np.sum(vector**2))
    return vector / norm if norm >0. else vector
standard vector normalization over any numpy array

    :param vector: iterable vector to normalise
    :type vector: numpy array
    
standard vector normalization over any numpy array
standard vector normalization over any numpy array
def normalise(vector):
    if isinstance(vector, np.ndarray)==False:
        vector = vec(vector)
    norm = np.linalg.norm(vector,2) 
    return vector / norm if norm >0. else vector
def normalise ( vector ) : if isinstance ( vector , np . ndarray ) == False : vector = vec ( vector ) norm = np . linalg . norm ( vector , 2 ) return vector / norm if norm > 0. else vector
standard vector normalization over any numpy array
standard vector normalization over any numpy array
"""standard vector normalization over any numpy array

    :param vector: iterable vector to normalise
    :type vector: numpy array
    """ #norm = math.sqrt(vector*vector) #equivalent to norm = np.sqrt(np.sum(vector**2))
vector
iterable vector to normalise
iterable vector to normalise