Grasshopper

algorithmic modeling for Rhino

konichiwa minasan.

i cannot figure out why vector and line are interchangable in many cases where the input requires direction, magnitude, and sense. both line and vector can be defined by start and endpoints.. so why are there both? why not do everything with lines?

arigatou gozaimasu.

Views: 5008

Replies to This Discussion

Vectors are not lines and they have a very different function than lines. A vector is a direction and a magnitude, that's it. It can also be made "magnitudeless" by being unitized (see Vicente's response to your other question). A line, of course, has direction and magnitude, but it also has LOCATION. A vector can be anywhere, but a line exists within space. Also, lines have a start and end point, again relating to their physical location. Vectors are expressed as displacement, so they do not technically have a start point, although conceptually that start point is 0,0,0.
A line consist on 2 points in 3d space. A line has a fixed position in 3d space. A vector only indicates a direction and a magnitude, not a position.

In terms of what data is actually being stored, since a vector only indicates direction and magnitude, assume that the start point is (0,0,0), the vector stores only the end point.
A line stores 2 sets of points. This is why you can go from a line to a vector but not from a vector to a line.
...I have to refresh the browser more often. At least it looks there is a consensus in this issue :P
damien and vicente,

i think i understand now.. although there are moments when i can use a line for a vector input parameter and think, "uh?".. but for the most part vector and line have different functions.

doumo arigatou gozaimashita!
In a number of places David has added "implicit conversions" between different types. What that really means is that if a component gets a different data type than it needs it will try to see if whatever you've supplied can be converted into the necessary data type. So for instance, there used to be a specific "Surface Domain" component, but it was removed because by simply sticking a surface directly into a 2D domain component it will extract the start and end values of each domain. The domain information is extracted directly from the surface because the component is trying to find what it needs from the input. In the same manner if you use a line where a vector is needed it will be converted for you. However, using a vector where a line is needed will cause the component to have an error.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service