Game Development

Vector Algebra and Its Uses In Computer Science

290

Vector Algebra

Mathematics

A vector is an object that has both a magnitude and a direction. Historically, vectors were introduced in geometry and physics (typically in mechanics) before the formalization of the concept of vector space. Though their uses in the fields of Mathematics and Computer Science are quite important as well. Today we will look at different concepts of vectors and their uses in game development and machine learning. <b><h2><center>What are Vectors?</b></h2></center> <i>A vector in the plane (2D) or space (3D) is an oriented segment that links a point (called origin or starting point) with another point (called terminal point)</i>. It has two fundamental properties which are <b>magnitude</b> and <b>direction</b> in comparison to scalars which have only one (magnitude). Using vectors, we can represent a lot of different physical quantities. <b><h2><center>Representation Of Vectors</b></h2></center> In physics, <i>vectors are represented with arrows on the top or they are normalized with respect to base vectors like <span>&#238;</span> and <span>&#309;</span></i>. But in computer science, we can't represent vectors in that form. Another way to represent vectors is in the form of <b>matrices</b>. We can use column or row matrices to represent different types of vectors and perform different kinds of operations on them. Here is an example: <center><img src="https://bl6pap004files.storage.live.com/y4m0Rzvn0O1kswYp3vMXpDel9kP6n4veyQDXEd47J_4elSY9tbkKg-xHkyTCksjh0yUdgXEuvh1dIQQltcX3_NnzAfqK9iKj5lbb-o-Jj1Nn1SwVVw55-2-QAadHTODMNqHKLW8xJ10ESiAuoijoTrN42SCern-3TR2WToIZJ7y3FmDcxG3yIHFXW2KsCfLZRjO?width=376&height=159&cropmode=none" width="376" height="159" /></center> <b><h2><center>Vectors in Game Development</b></h2></center> Vectors are very important in game development. One of the most popular game development tools is Unity. Unity3D is used for developing three-dimensional graphics and games. Game development requires the concepts of vectors in physics and maths. Using vectors you can specify the velocity, position of an object in a game. For example, <i>a game can calculate how much an object rotated with help of the direction it was facing initially and the final direction after the completion of rotation</i>. Here is the formula for that: <center><img src="https://bl6pap004files.storage.live.com/y4moennInri36idFiP4WYhv_dcf8X-AWghb854EsT27rYAH7uxkq4d_QUn2vLsL3JnFkFImDF95bqBKP96U8ZwHXFokjAjb429-wJTKmJZLF8Vc1hNHFRdj_pzvrn3Iy9oCRqKKRGa1ZDnWj-BOvll6KRb0N0ONExUCrVwRcnIWmDL8JtNFvMCz6hbsg_VSu_mU?width=237&height=94&cropmode=none" width="237" height="94" /></center> A game can involve many different kinds of tasks like <b>rotation, movement, checking relative positions of different objects in a game</b>, etc. These are some basic tasks in a game. While developing a real game you may need to do some more complex tasks which you may be able to define on basis of combinations of different simpler tasks. <b><h2><center>Vectors in Machine Learning</b></h2></center> <i>Machine Learning is about defining such algorithms that can use the available data to make predictions and do other similar tasks</i>. As machine learning is all about data, <b>the most convenient way of storing this data is in the form of vectors.</b> After storing the data in vectors (matrices), we can define machine learning algorithms that can use vector algebra and calculus to manipulate the data to make predictions or classify data in different categories (or maybe some other task that you want to perform).

- Ojas Srivastava, 08:58 PM, 30 Jul, 2021

Machine Learning