1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kenny6666 [7]
3 years ago
5

I am trying to create a line of code to calculate distance between two points. (distance=[tex]\sqrt{ (x2-x1)^2+(y2-y1)^2}) My li

ne is point_dist = math.sqrt((math.pow(x2 - x1), 2) + math.pow(y2 - y1), 2) but I am getting an error saying that pow is expecting two arguments and is only getting one. Can anyone help me?
Engineering
1 answer:
k0ka [10]3 years ago
6 0

Answer:

point_dist = math.sqrt((math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2))

Explanation:

The distance formula is the difference of the x coordinates squared, plus the difference of the y coordinates squared, all square rooted.  For the general case, it appears you simply need to change how you have written the code.

point_dist = math.sqrt((math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2))

Note, by moving the 2 inside of the pow function, you have provided the second argument that it is requesting.

You were close with your initial attempt, you just had a parenthesis after x1 and y1 when you should not have.

Cheers.

You might be interested in
May you tell me the meaning of "Tolerance is a bitter tree, but its fruit is sweet "by Aristotle
trapecia [35]

Answer:

“Patience is bitter, but its fruit is sweet. With patience you can bear up under any adversity and survive any defeat. With patience you can control your destiny and have what you will. Patience is the key to contentment, for you and for those who must live with you. To be brave without patience can kill you.

Explanation:

Aristotle’s Ethical Doctrine of the Mean. According to Aristotle’s ethical rule about the Golden Mean, to use a thing with virtue is a kind of moderation, as it leads the particular thing being in a good condition, and allows for its functions to be performed in a proper manner.

7 0
3 years ago
What is an obstacle that holds people back from getting their car fixed?
docker41 [41]

Answer:

Not having enough money to pay to get it fixed

Explanation:

6 0
3 years ago
Read 2 more answers
Draw isometric projection of a pls help
Genrish500 [490]

Draw isometric projection Spatial axes of the item are represented as similarly willing to the drawing floor and same distances alongside the axes are drawn the same.

<h3>What is isometric projection?</h3>

Definition of isometric projection an axonometric projection wherein the 3 spatial axes of the item are represented as similarly willing to the drawing floor and same distances alongside the axes are drawn same.

An isometric view of an item may be received via way of means of selecting the viewing path such that the angles among the projections of the x, y, and z axes are all of the same, or 120°. For example, with a cube, that is achieved via way of means of first searching immediately toward one face.

Read  more about the data:

brainly.com/question/25749514

#SPJ1

8 0
2 years ago
3. A competency-based training program is
Vesna [10]
C and B is the answer of the questions
7 0
4 years ago
What is the ls option that prints the author of a file?​
nataly862011 [7]

Answer:

You need to use option '–author' along with option '-l' to print the author name of each file.

Explanation:

hopefully this helps you sorry if it doesn’t help you

4 0
3 years ago
Other questions:
  • Next → Fluid Systems: Mastery Test Select the correct answer from each drop-down menu. What type of systems are used in the Indu
    14·1 answer
  • A rectangular beam of width b = 15 in., effective depth d = 20.5 in., and total depth h = 23 in. spans 18.5 ft. between simple s
    14·1 answer
  • To operate a vehicle in Florida, you must
    10·2 answers
  • The time to failure for a gasket follows the Weibull distribution with ß = 2.0 and a characteristic life of 300 days. What is th
    13·1 answer
  • What is the rms current flowing through a light bulb that uses an average power of 60.0 60.0 W when it is plugged into a wall re
    12·1 answer
  • According to the HERARCHY of hazard control what sequence is specified for protecting workers from chemical hazards assume that
    7·1 answer
  • What is a two stroke engine and what is a four stroke engine, please keep the definitions as simple as can be and please explain
    8·2 answers
  • Nitrogen enters a steady-flow heat exchanger at 150 kPa, 10°C, and 100 m/s, and it receives heat as it flows through it. Nitroge
    15·1 answer
  • An automobile travels along a straight road at 15.65 m/s through a 11.18 m/s speed zone. A police car observed the automobile. A
    9·1 answer
  • Which one is your choice and Why?​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!