Vectors and Coding

This was my first lesson of coding with Ant where I learnt a lot about coding.

Vector: A vector is, In the C++ programming language, a vector is an implementation of a dynamically resizable array data structure.

When coding, there are two common errors that occur, these are:

Syntax Error – a syntax error is an error in the syntax of a sequence of characters or tokens that is intended to be written in a particular programming language. For compiled languages, syntax errors are detected at compile-time. A program will not compile until all syntax errors are corrected.

Semantic Error –  These are valid code the compiler understands, but they do not what you, the programmer, intended.

I also learned about cross products. Cross products are the product of two real vectors in three dimensions which is itself a vector at right angles to both the original vectors. Its magnitude is the product of the magnitudes of the original vectors and the sine of the angle between their directions.

Using my new found knowledge of coding I created scripts that allowed a Ship (that was already modelled) to be followed by a missile that had a homing script attached to it, all using vectors and all of the above.

Shizzle

This slideshow requires JavaScript.

Leave a comment

Design a site like this with WordPress.com
Get started