<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def twovec(axdef, indexa, plndef, indexp):
 """ Find the transformation to the right-handed frame having a given vector as a specified axis and having a second given vector lying in a specified coordinate plane. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/twovec_c.html :param axdef: Vector defining a principal axis. :type axdef: 3-Element Array of floats :param indexa: Principal axis number of axdef (X=1, Y=2, Z=3). :type indexa: int :param plndef: Vector defining (with axdef) a principal plane. :type plndef: 3-Element Array of floats :param indexp: Second axis number (with indexa) of principal plane. :type indexp: int :return: Output rotation matrix. :rtype: 3x3-Element Array of floats """

    axdef = stypes.toDoubleVector(axdef)
    indexa = ctypes.c_int(indexa)
    plndef = stypes.toDoubleVector(plndef)
    indexp = ctypes.c_int(indexp)
    mout = stypes.emptyDoubleMatrix()
    libspice.twovec_c(axdef, indexa, plndef, indexp, mout)
    return stypes.cMatrixToNumpy(mout)