Grasshopper

algorithmic modeling for Rhino

Hi all

If I have a list of unit vectors in VB and I wanted to calculated the vector between some other arbitrary unit vector, is there a way to do this through VB, as opposed to outputting into a list and using GH nodes downstream? 

Preemptive thanks!

Views: 392

Replies to This Discussion

You can use the Shared Rhino.Geometry.Vector3d.VectorAngle() function. It has two overloads, one which just computes the smallest angle through which you'd have to rotate one vector to get the other, and a function which calculates the angle in a specific plane.

Neither of them use the DotProduct operator, which is faster and sometimes suffices. The DotProduct does not allow you to determine that two vectors are pointing away from each other, instead you'll get the angle as if one vector were reversed.

Thanks David!!! Always good to hear from the creator. 

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service