Hi, You need two vectors for cross product. If you want you can find a random tangent for a single vector, but that's slightly more complicated.
For cross-product you can use the mel-command 'cross' or the MVector-class from Python API that has overloaded operator for cross product (the caret-symbol). Example code for api: import maya.api.OpenMaya as api p1 = [0, 1, 0] p2 = [1, 0, 0] vec_p1 = api.MVector(p1) vec_p2 = api.MVector(p2) cross = vec_p1^vec_p2 Hope that helps. Cheers, Risto On Wed, Oct 29, 2014 at 2:30 PM, sam williams <[email protected]> wrote: > Hello;) > > im trying to find the perpendicular vector to a vector. I know i need to > use the cross product, but it can be tedious to write is all out manually. > But does anyone know of an in built way of finding it in python. other than > using numpy. > > thanks alot, > Sam > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/59288e12-505b-4444-9d2f-0feb2fdfbe75%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/59288e12-505b-4444-9d2f-0feb2fdfbe75%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CA%2B5uDBb3nQC27UX0My-PVLX7-obuMdazJRd9v%2B0n5GHqC7FJaw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
