Unpack three scalar components from a vector.

    http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vupack_c.html

    :param v: Vector 
    :type v: 3-Element Array of floats
    :return: (x, y, z)
    :rtype: tuple
971935
def vupack(v):
    
    v1 = stypes.toDoubleVector(v)
    x = ctypes.c_double()
    y = ctypes.c_double()
    z = ctypes.c_double()
    libspice.vupack_c(v1, ctypes.byref(x), ctypes.byref(y), ctypes.byref(z))
    return x.value, y.value, z.value
80294
def sub_v2(v, w):
    

    if type(w) is float or type(w) is int:
        return Vec2(v.x - w, v.y - w)
    else:
        return Vec2(v.x - w.x, v.y - w.y)
1261305
def vectors2angle(v1, v2):
    
    cosang = np.dot(v1, v2)
    sinang = np.linalg.norm(np.cross(v1, v2))
    return np.arctan2(sinang, cosang)
23237
def projection_as_vec_v3(v, w):
    
    proj_len = projection_v3(v, w)
    return scale_v3(v, proj_len)
798131
def hash_vector(self, v, querying=False):
        
        if scipy.sparse.issparse(v):
            # If vector is sparse, make sure we have the CSR representation
            # of the projection matrix
            if self.components_csr == None:
                self.components_csr = scipy.sparse.csr_matrix(self.components)
            # Make sure that we are using CSR format for multiplication
            if not scipy.sparse.isspmatrix_csr(v):
                v = scipy.sparse.csr_matrix(v)
            # Project vector onto all hyperplane normals
            projection = (self.components_csr.dot(v) / self.bin_width).floor().toarray()
        else:
            # Project vector onto components
            projection = numpy.dot(self.components, v)
            projection = numpy.floor(projection / self.bin_width)
        # Return key
        return ['_'.join([str(int(x)) for x in projection])]
156700
def get_vert_connectivity(mesh_v, mesh_f):
    """"""

    vpv = sp.csc_matrix((len(mesh_v),len(mesh_v)))

    # for each column in the faces...
    for i in range(3):
        IS = mesh_f[:,i]
        JS = mesh_f[:,(i+1)%3]
        data = np.ones(len(IS))
        ij = np.vstack((row(IS.flatten()), row(JS.flatten())))
        mtx = sp.csc_matrix((data, ij), shape=vpv.shape)
        vpv = vpv + mtx + mtx.T

    return vpv
783735
def vector(x, y=None, z=0.0):
    
    if y is None:  # assume x is already [x,y,z]
        return np.array(x, dtype=np.float64)
    return np.array([x, y, z], dtype=np.float64)
254072
public float dot(Vector3fc v) {
        return dot(v.x(), v.y(), v.z());
    }
1105508
function packVector(vector, includeMetadata) {
  includeMetadata = isUndefined(includeMetadata) ? true : includeMetadata;
  var dtype = vector.dtype;
  if (vector.dtype === 'date') {
    vector = vector.toDtype('number');
  }
  var values = (vector.dtype !== 'number') ?
    vector.values.slice() :
    vector.values.map(function(x) {
      return Number.isNaN(x) ? null : x;
    });

  var result = {dtype: dtype, values: values};
  if (includeMetadata) {
    result.version = jd.version;
    result.type = vectorProto.type;
  }
  return result;
}
625827
def numpy_array_from_list_or_numpy_array(vectors):
    
    # If vectors is not a numpy matrix, create one
    if not isinstance(vectors, numpy.ndarray):
        V = numpy.zeros((vectors[0].shape[0], len(vectors)))
        for index in range(len(vectors)):
            vector = vectors[index]
            V[:, index] = vector
        return V

    return vectors
633484
public Vector3f div(Vector3fc v, Vector3f dest) {
        dest.x = x / v.x();
        dest.y = y / v.y();
        dest.z = z / v.z();
        return dest;
    }
160809
def component_mul(vec1, vec2):
        """"""
        new_vec = Vector2()
        new_vec.X = vec1.X * vec2.X
        new_vec.Y = vec1.Y * vec2.Y
        return new_vec
76382
def translate_v3(vec, amount):
    """"""

    return Vec3(vec.x+amount, vec.y+amount, vec.z+amount)
1067867
def make_nd_vec(v, nd=None, t=None, norm=False):
    

    # Imports
    import numpy as np
    from scipy import linalg as spla

    # Reduce the input to the extent possible
    out_v = np.array(v, dtype=t).squeeze()

    # Confirm vector form
    if not len(out_v.shape) == 1:
        raise ValueError("'v' is not reducible to a vector.")
    ## end if

    # If indicated, confirm dimensionality
    if nd and not out_v.shape[0] == nd:
        raise ValueError("'v' dimension is " + str(out_v.shape[0]) +
                ", not " + str(nd))
    ## end if

    # Normalize, if indicated
    if norm:
        out_v = out_v / spla.norm(out_v)
    ## end if

    # Return result
    return out_v
667229
public static float dot(float[] u,float[] v) {
        return ((u[X] * v[X]) + (u[Y] * v[Y]) + (u[Z] * v[Z]));
    }
86896
def _unpack_v1(h5file):
    ''''''
    points = np.array(h5file['points'])
    groups = np.array(h5file['structure'])
    return points, groups
1002022
def cross(self, vec):
        """"""
        if not isinstance(vec, Vector3Array):
            raise TypeError('Cross product operand must be a Vector3Array')
        if self.nV != 1 and vec.nV != 1 and self.nV != vec.nV:
            raise ValueError('Cross product operands must have the same '
                             'number of elements.')
        return Vector3Array(np.cross(self, vec))