Computers and Technology
Computers and Technology, 10.04.2020 20:33, hfkdnd

Here are some of the operations you can perform on a vector.• vector addition. If V1 is (x, y) and V2 is (a, b), the V+W is (x+a, y+b), a vector• vector multiplication by a scalar. if V1 is (x, y), the V*n is (x*n, y*n), a vector• vector subtraction V-W is the same as V+(W*-1), a vector• vector multiplication with another vector. There are two possibilities, dot product or cross product. We’ll do dot product. If V=(x, y) and W=(a, b), then V*W = x*a + y*b, a scalar. Thus the dot product yields a scalar, not a vector• vector magnitude. The magnitude based on the Pythagorean theorem for a V=(x, y) says that the magnitude is sqrt(x^2 + y^2) might look at math. hypot for this!, Question: Your Tasks is to Make a vector class. Provide the operators with documentation.__init__ # constructor, takes 3 args: self, x,y . No return__str__ # for printing, takes 1 arg self. Returns a string__add__ # vector + vector. Takes 2 args, self and vector. Returns a new vector__sub__ # vector – vector. Takes 2 args, self and vector. Returns a new vector__mul__ # two possibilities. vector*integer or vector*vector (dot product). Get it to do just one of# the two at first, then see if you can use introspection to do bothmagnitude # magnitude of the vector. One arg, self. Returns a float

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:40, almaga1979orfvwo
5. illustrate how fine-line inventory classification can be used with product and market segments. what are the benefits and considerations when classifying inventory by product, market, and product/market?
Answers: 2
image
Computers and Technology, 22.06.2019 23:00, nicog94
In which part of a professional email should you try to be brief, but highly descriptive?
Answers: 1
image
Computers and Technology, 23.06.2019 05:00, mariahchaparro08
Which best explains why a digital leader would join a society specializing in technology
Answers: 1
image
Computers and Technology, 23.06.2019 06:30, QueeeenUknown7437
How do you write an argumentative essay about the importance of free enterprise ?
Answers: 1
Do you know the correct answer?
Here are some of the operations you can perform on a vector.• vector addition. If V1 is (x, y) and V...

Questions in other subjects:

Konu
Mathematics, 31.08.2020 03:01
Konu
Mathematics, 31.08.2020 03:01