def vadd ( v1 , v2 ) : v1 = stypes . toDoubleVector ( v1 ) v2 = stypes . toDoubleVector ( v2 ) vout = stypes . emptyDoubleVector ( 3 ) libspice . vadd_c ( v1 , v2 , vout ) return stypes . cVectorToPython ( vout )
how to add vectors in python with ctypes structure
Add two 3 dimensional vectors . http : // naif . jpl . nasa . gov / pub / naif / toolkit_docs / C / cspice / vadd_c . html
def vadd(v1, v2):
    """ Add two 3 dimensional vectors.
    http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vadd_c.html

    :param v1: First vector to be added. 
    :type v1: 3-Element Array of floats
    :param v2: Second vector to be added. 
    :type v2: 3-Element Array of floats
    :return: v1+v2
    :rtype: 3-Element Array of floats
    """
    v1 = stypes.toDoubleVector(v1)
    v2 = stypes.toDoubleVector(v2)
    vout = stypes.emptyDoubleVector(3)
    libspice.vadd_c(v1, v2, vout)
    return stypes.cVectorToPython(vout)