Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by HauntedHotPocket · Nov 24, 2013 at 08:23 AM · floatvector

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.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image fafase · Nov 24, 2013 at 08:25 AM 0
Share

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

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

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

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image HauntedHotPocket · Dec 12, 2013 at 10:08 PM 0
Share

Thanks so much for the help!

avatar image HauntedHotPocket · Dec 12, 2013 at 10:09 PM 0
Share

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?

avatar image rutter · Dec 12, 2013 at 10:09 PM 0
Share

@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. :)

avatar image HauntedHotPocket · Dec 12, 2013 at 10:12 PM 0
Share

Is it always assu$$anonymous$$g the vector is calculated from your current position (0,0), or (0,0,0)? Sorry for the noobery.

avatar image ejpaari · Dec 13, 2013 at 07:32 AM 0
Share

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

  1. Vector has a direction and a magnitude (as you can see: http://www.mathsisfun.com/algebra/vectors.html)

  2. 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

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges