Skip to content

sps-lco-2020-21/vector-introductions-zacstalbow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An introduction to vectors

The syllabus in section 4.2.8 introduces what you need to know about vectors.

The Bond 1 text book (available through your Google Classroom reference materials) pages 300-302 discusses some of the functions.

For this exercise:

Create a Vector class and in it write functions that:

  • adds two vectors together
  • performs scalar vector multiplication
  • calculates the algebraic dot product of two vectors u and v
  • calculates the convex combination of two vectors u and v of the form au + bv where a,b >= 0 and a+b = 1
  • calculates the geometric dot product of two vectors u and v
  • takes two vectors u and v and returns the angle between the two vectors (perhaps offer a boolean to specify radians or degrees)

Make sure you include adequate testing. Your Vector class should be able to instantiate vectors of different classes.

You might consider creating a bespoke exception to deal with certain situations (e.g. a dot product of vectors of different sizes).

About

vector-introductions-zacstalbow created by GitHub Classroom

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages