- Home /
Understanding Arithmetic & Vector Data
I'm trying to understand the math involved in adding and multiplying vector data.
ADDING 2 VECTORS:
If I add 2 vectors (2,3,1) + (1,1,4) , Will that give me (3,4,5) ?
Does it add them together?
MULTIPLYING AGAINST A FLOAT
If I multiply a vector **(2,3,4) 3.5 , is it multiplying all 3 numbers against the float individually to give me (7,10.5, 14)*?
Again, just trying to understand what's going on under the hood a little better.
Yes it is. Addition creates a new vector out of all the vectors you are adding. $$anonymous$$ultiplication extends the vector if the scalar is greater than 1 and reduces it if smaller than 1. At 0, you have a vector zero, less than 0 you invert the direction of the vector. Dividing is the same process. http://docs.unity3d.com/Documentation/$$anonymous$$anual/UnderstandingVectorArithmetic.html
Answer by ejpaari · Nov 24, 2013 at 08:59 AM
Yes that is right. Here's some more http://www.mathsisfun.com/algebra/vectors.html
This is great, but the thing I'm not clear on is that in the illustrations, Vectors are represented with arrows. This implies they are a line/ray and not a point? Not sure where they get the direction from. It seems like X,Y, or X,Y,Z would just give you a solitary point, not an arrow. Could you explain this?
@HauntedHotPocket: Don't forget to upvote helpful answers, and to mark successful answers as accepted. I've taken the liberty of doing that for you, here. :)
Is it always assu$$anonymous$$g the vector is calculated from your current position (0,0), or (0,0,0)? Sorry for the noobery.
This implies they are a line/ray and not a point? Not sure where they get the direction from. It seems like X,Y, or X,Y,Z would just give you a solitary point, not an arrow. Could you explain this?
They look similar and are easy to confuse. Here are a couple of differencies between a point and a vector
Vector has a direction and a magnitude (as you can see: http://www.mathsisfun.com/algebra/vectors.html)
Point represents a location. For example point (2, 2) has one unambigious location. Vector [2, 2] ins$$anonymous$$d is not bounded similarly. It can be the vector between points (10, 10) and (8, 8) or (100, 100) and (98, 98), doesn't matter.
In Unity there is a data type called Vector2. This kind of data type is nevertheless used as a point and a vector even though the name is Vector2 so it can be a bit confusing sometimes.
Is it always assu$$anonymous$$g the vector is calculated from your current position (0,0), or (0,0,0)?
No. Vectors can be calculated between any points (as mentioned above). Here is another link that might be helpful.
Your answer
Follow this Question
Related Questions
X,Y,Z coords of vector greater or equal or lesser or equal comparison 1 Answer
Convert localScale to float? 1 Answer
Link a value to another value in the Inspector 1 Answer
Vector3 constructor precision 1 Answer
How to get a vector3 (postion) 1 unit away from another in the direction of a 3rd vector3? 2 Answers