Grasshopper

algorithmic modeling for Rhino

Hey all, so i'm totally new to scripting and i'm wondering how can this be done

Evaluate the angle (a) between a vector and x axis

If (a) is positive

then rotate the vector about z axis with angle value (-a)

else rotate the vector about z axis with angle value (a)

I thought of dispatching the vector list with a logic button on gh and having two rotation "processes", but the problem is that i need the original order of the list for later operations

Thank in advance!

Views: 4428

Replies to This Discussion

Angle in 3d are always positive and in [0, PI].

You need to supply a plane to get an oriented angle (think of the argument of a complex number...)

You're right. I can not. I apologize for that.
For some reason the plane's z axis gets flipped once you pass the pi angle:

Attachments:

It boils down to this. Whenever you measure the angle between 2 vectors and generate the plane from the same two vectors you will get a 0 to PI. If you then measure a third vector but use the Plane based on the first two you can have anything from 0 to 2*PI.

To clarify this a little further:

When generating the plane from the crossProdukt(A,B) and than measuring the angleBetween(A,B) you get a angle between 0 and PI

but when computing the angleBetween(B,A) using the same crossProdukt vector you get an angle between Pi and 2*PI...

So the orientation of the plane Normal is of essence!

Again:

http://stackoverflow.com/questions/5188561/signed-angle-between-two...

thank you!

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service