Grasshopper

algorithmic modeling for Rhino

Namaste all,

Don't know if this is the right place to ask this question but here it goes anyways,I have only recently started exploring CG and came across Vector mathematics.

Its a very basic question. Why do we specifically use Vectors? Aren't points sufficient for all the mathematics involved? As in,we store vectors as co-ordinate(same as points),there is no extra info indicating its direction or anything. A point will have 3 pieces of data, its X,Y and Z coordinates,same is the case with vector.

So if the computer have only these 3 numbers to work with for whatever operation it may want to do(moving,scaling, rotating e.t.c) why differentiate btw points and Vectors?

Why bring vectors into the picture at all? 

Thanks. 

Views: 893

Replies to This Discussion

" As in,we store vectors as co-ordinate(same as points),there is no extra info indicating its direction or anything. A point will have 3 pieces of data, its X,Y and Z coordinates,same is the case with vector."

But a vector is a direction. A point is not a direction. A vector is two points. So for one it is a way to use one thing (vector) vs two things (points). Vectors can inform things how to move and can be infinite. So for instance, if i wanted something to move in a specified direction forever without me defining a definitive end I would need a vector. I think maybe you confuse vector "length" with vector "direction". Where a vectors length and direction can be defined ultimately by a start and end point. But it's direction can be important to many operations and can go beyond the end point forever. This is why often unitized vectors are used just to use the direction, and the actual length becomes irrelevant.

Additionally, the vector "length" can just be seen as another way to define things. There is rarely ever one way to define. For instance, you might say well why do i need a mesh since really that is also just a grid of points displayed as faces.   

A vector is a direction and magnitude.  "surface normal" direction, for example, which isn't necessarily obvious on a curved surface.  Tangents are also common uses for vectors, like this joining of two curves so that their ends always remain aligned:

http://www.grasshopper3d.com/xn/detail/2985220:Comment:1814663

Attachments:

Practically, and programmatically, there is no difference between points and vectors. Both are lists-of-coordinates with a bunch of associated operations. In fact plenty of programming platforms/languages do not distinguish between points and vectors, and sometimes not even between vectors and colours. GLSL shaders for example treat all coordinates, vectors and colours as 2d, 3d or 4d vectors.

However theoretically, and mathematically, they are very different entities and it is just easier to think with them if you keep them separate. As mentioned by Michael and Joseph already, points are locations in space specified using a set of coordinates, whereas vectors are directions+magnitudes in space, specified using a set of coordinate differences. Vectors are not geometry, and whenever we draw a vector in some specific place, we can only do so because we know, from the context, where that vector makes sense.

In physics and mathematics I'm given to understand that it often makes sense to denote points and vectors as either row-vectors or column-vectors respectively. I.e. either a matrix containing only a single row of numbers, or a matrix containing only a single column of numbers. In such an approach, points and vectors actually do behave very differently when used in equations and computations. But this is not something you typically have to worry about when dealing with 'simple' geometric stuff like CAD.

Conceptually, points and vectors are different things and as such they have different operations associated with them. Let's imagine we write points using round brackets (because points are dot-like nature) and vectors using angled brackets (because vectors are like arrows). Thus (x,y,z) would be a three dimensional point whereas ⟨a,b,c⟩ would represent a three-dimensional vector.

We can define a meaningful addition operation on two vectors by simply adding the respective magnitudes; ⟨a,b,c⟩+⟨i,j,k⟩=⟨a+i,b+j,c+k⟩. This operation takes in two vectors and outputs a vector. This turns out to be a useful operation because we end up needing it all over the place, for example when combining forces or motions.

We can also choose to define an addition operation on a point and a vector which looks (and is) entirely identical; (x,y,z)+⟨i,j,k⟩=(x+i,y+j,z+k). Note that this time the inputs of the addition are one point and a one vector, while the output is a point. This, too, is a useful operation because you can think of it as moving a point along a vector, which is something you need to do all the time. Are these two operations 'different'? Conceptually, yes. Computationally, no.

Would it make sense to define an addition operator which adds two points together? How about subtraction? How about multiplication? Well, sometimes it makes a lot of sense, sometimes it makes a little sense, sometimes it makes no sense. But by keeping points and vectors separate, I think there is less confusion, and I think it's easier to find mistakes. 

Just to add, the Essential Mathematics For Computational Design compendium by McNeel is a great resource here.

Just for fun.  Surface normal vectors with options for 'UV Count' and 'Vector Length', where 'Vector Length' can be either "Uniform ", "U Curvature", "V Curvature" or "U+V" - used to create offset surface ('SrfGrid'):

Attachments:

Attachments:

Gradient vector colors and ability to display curvature vectors (which flip on peaks and valleys) or surface normal vectors, as before:

Attachments:

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