Question: Implementing a 2-D Vector Class Out: 11/6 Due: 11/17 by 11:50 PM Learning Objectives o Implementing a Class . Writing Constructors, Mutators and Accessors .




Implementing a 2-D Vector Class Out: 11/6 Due: 11/17 by 11:50 PM Learning Objectives o Implementing a Class . Writing Constructors, Mutators and Accessors . Testing a Class Definition 1. A vector is defined as an element of a vector space. In the commonly used vector space R" (Euclidean n-space), a vector is denoted by n coordinates and can be specified as (x1,22, ..., Tn). Vectors are usu- ally referred to by the number of coordinates they have. A 2-dimensional vector x1,x2) is may be referred to as a two-vector. More generally, an n-dimensional vector may be referred to as n-vector. Binary operations such as addition, subtraction and multiplication by scalars are defined on vectors. Vector multiplication is not unique; different types of vector products, such as the dot product and cross product are defined as binary operations on vectors Definition 2. The vector norm of a two-vector v- (x,y), denoted l is equals to Vr2 + y2. Definition 3. The unit vector of a two-vector v - (x,y), denoted - FT = mtT. The norm of the unit vector is 1. The unit vector for the zero vector is undefined Definition 4. Two vectors in R2, U1-(zl,y1) and v2(z2,U2)are equal if and only if corresponding coordinates are equal; that is, r1 and
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
