subject
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

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 14:20, capo9972
Cengagenowv2 is a comprehensive online learning tool. using cengagenowv2, you may access all of the following except: 2. each time you log in, cengagenowv2 automatically performs a system check and informs you if your computer does not meet the cengagenowv2 system requirements. 3. which tab/page allows you to easily track your assignment scores, number of submissions, time spent, as well as the ability view assign
Answers: 3
image
Computers and Technology, 24.06.2019 21:50, carter4026
The use of phrases, fragments, and punctuation can influence the mood of a passage; keeping this in mind, how would you describe the mood of the followingpassage? "fog on the essex marshes, fog on the kentish heights, fog creeping into the cabooses of collier-brigs; fog lying out on the yards, and hovering in the riggingof great ships; fog drooping on the gunwales of barges and small boats. fog in the eyes and throats of ancient greenwich pensioners, wheezing by thefiresides of their wards; fog in the stem and bowl of the afternoon pipe of the wrathful skipper; fog cruelly pinching the toes and fingers of his shivering little'prentice boy on deck." (5 points)
Answers: 2
image
Computers and Technology, 24.06.2019 23:00, elha20
The valves of the heart and veins are similar in that they both
Answers: 1
image
Computers and Technology, 24.06.2019 23:00, amandajennings01
Why is it preferable to code web pages in html format? a. to create more lines code b. to apply general formatting rules c. to display properly as search results in all browsers d. to add meaning to the document
Answers: 1
You know the right 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, 05.03.2021 16:30