Grasshopper

algorithmic modeling for Rhino

I have 3 points and I want to find the angle between them so I need to create 2 vector with which to measure said angle.  How do I create the vectors within VBScript?

Views: 1603

Replies to This Discussion

You can create a vector with two points, let's say p1 and p2:

 

Dim vec As New Vector3d(p1.X - p2.X, p1.Y - p2.Y, p1.Z - p2.Z)

 

And other than Vector3d.VectorAngle method in rhinocommon, attached VB component computes angle between vectors, returning + and - values as well.

Attachments:

Or use the subtraction operator directly:

 

Dim vec As Vector3d = p2 - p1

 

--

David Rutten

david@mcneel.com

Turku, Finland

Got it.

thx

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service