Much like last week with class diagrams & trigonometry, Ant wants up to get a heads up on next weeks content. So here we go with some online research.
Alright some of this seems to make a little more sense than class diagrams initially. From what I can gather an Array can be considered a collection of variables all with the same data type and all sharing the same name (the name of the array).
An example I came across used game scores as a means to explain. Say there were ten scores to hold in memory for a game, this would normally be ten variables. For ease we’ll say these would be gamescore1 through 10. Instead you declare one array variable of gamescore(10), the number in brackets determines how many data items the array will hold. A specific ‘variable’ in an array is accessed by an index.
So I looked up lists and immediately found this:
A list (also called an array in other programming languages) is a tool that can be used to store multiple pieces of information at once. It can also be defined as a variable containing multiple other variables.
So I guess the terms are interchangeable depending on the language you are using. The only difference I found is that arrays only store one type of data. So when the array is created if it was assigned int for example it can’t contain anything else. Whereas lists can contain more than one data type.
Another concept I’ve not dealt with or used for half my life time. Much like trigonometry Pythagoras Theorem deals with right angled triangles and calculating lengths/missing sides but without the need for an angle.
“Pythagoras’ theorem states that for all right-angled triangles, ‘The square on the hypotenuse is equal to the sum of the squares on the other two sides’.”
Thanks for that quick description BBC.
So in short a² = b² + c²
The other sides work as follows:
b² = a² – c²
c² = a² – b²
We need the length of LM, which is c.
c² = 6² – 4²
c² = 36 – 16
c² = 20
c = √20
c = 4.5cm (1 decimal place)
As an extra note the theorem can also be used to determine if a triangle is NOT right handed since it only works with right handed triangles.
If a² < b² + c² the angle is acute (less than 90º)
If a² > b² + c² the angle is obtuse (between 90º and 180º)
Until context is given this is confusing my very non logical brain. The basic part I can gather is to take a vector of any length and change its length to one while still pointing in the same orientation.
The vector (or the hypotenuse it seems) would need to be divided by itself to get a value of one, you then divide the remaining sides by the same number to normalise those. I saw briefly some notes about using the process to simplify the vector math as you generate smaller numbers but I’m still not 100% sure of its full purpose.