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
True or False<br> Most coolants you put into your car are toxic.
swat32

Answer: True.

Explanation: Coolant is flammable and toxic.

8 0
3 years ago
Read 2 more answers
The results of a _________ test will determine if there is suitable drainage and the size of the drain field that will be requir
topjm [15]

Answer:

The results of a percolation test will determine if there is suitable drainage and the size of the drain field that will be required for a septic system.

7 0
2 years ago
Select the correct answer.
cricket20 [7]

Answer:

A.

The power generated by a wind farm is not constant because of irregular wind patterns.

5 0
3 years ago
An excavation is at risk for cave-in and water accumulation because of the excess soil that has accumulated. What type of excava
s344n2d4d5 [400]

Answer:

Among the different types of excavation protection system, as a way of preventing accidents against cave-ins, the sloping involves cutting back the trench wall at an angle inclined away from the excavation. Shoring requires installing aluminum hydraulic or other types of supports to prevent soil movement and cave-ins. Shielding protects workers by using trench boxes or other types of supports to prevent soil cave-ins (OSHA). In addition, the regulations do not allow employees to work on excavations where there is an accumulation of water. If this occurs, water on the site must be constantly removed by suitable equipment preventing water from accumulating. The entry of surface water into the excavations must also be prevented by means of diversion ditches, dam, or other suitable means.  

Explanation:

3 0
3 years ago
Which material has the highest cp value?
Nataly [62]

Answer: B. Water

Explanation:

6 0
3 years ago
Other questions:
  • Define the Problem
    11·1 answer
  • The rate of energy transfer by work is called power. a)-True b)-False
    15·1 answer
  • Benzoic acid 1.35 g, is reacted with oxygen in a constant volumecalorimeter to form H2 O(l) and CO2 (g)at 298 K. the mass of the
    7·1 answer
  • Describe ICP/OES in detail.
    6·2 answers
  • What is the relative % change in P if we double the absolute temperature of an ideal gas keeping mass and volume constant?
    14·1 answer
  • Turbine blades mounted to a rotating disc in a gas turbine engine are exposed to a gas stream that is at [infinity] = 1100°C and
    6·1 answer
  • You’re going to write a program that models the Littleton City Lotto (not a real Lotto game). The program is going to allow to u
    6·1 answer
  • What does the current in a semi-conductor is produced by?
    15·2 answers
  • Since no one is perfect is that a sentence fragment
    10·2 answers
  • QUICK ASAP
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!