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
Exceeding critical mach may result in the onset of compressibility effects such as:______.
klio [65]

Answer:

Sound barrier.

Explanation:

Sound barrier is a sudden increase in drag and other effects when an aircraft travels faster than the speed of sound. Other undesirable effects are experienced in the transonic stage, such as relative air movement creating disruptive shock waves and turbulence. One of the adverse effect of this sound barrier in early plane designs was that at this speed, the weight of the engine required to power the aircraft would be too large for the aircraft to carry. Modern planes have designs that now combat most of these undesirable effects of the sound barrier.

4 0
3 years ago
Vẽ thủ tục cho một cuộc gọi thuê bao
shusha [124]

Lo siento, no sé qué estás diciendo.

8 0
3 years ago
The minimum safe working distance from exposed electrical conductors
SVEN [57.7K]

Answer:

b

Explanation:

4 0
3 years ago
Bending is defined as? A. the application of a load tending to distort a member in one direction. B. the application of opposing
amm1812
Hi how are you today
4 0
2 years ago
A three-point bending test is performed on a glass specimen having a rectangular cross section of height d 5 mm (0.2 in.) and wi
Anon25 [30]

Answer:

The flexural strength of a specimen is = 78.3 M pa

Explanation:

Given data

Height = depth = 5 mm

Width = 10 mm

Length L = 45 mm

Load = 290 N

The flexural strength of a specimen is given by

\sigma = \frac{3 F L}{2 bd^{2} }

\sigma = \frac{3(290)(45)}{2 (10)(5)^{2} }

\sigma = 78.3 M pa

Therefore the flexural strength of a specimen is = 78.3 M pa

4 0
3 years ago
Other questions:
  • Explain the four criteria for proving the correctness of a logical pretest loop construct of the form "while B do S end". And pr
    12·1 answer
  • Saturated liquid water at 150 F is put under pressure to decrease the volume by 1% while keeping the temperature constant. To wh
    8·1 answer
  • How to Cancel prescription
    12·1 answer
  • What have you learned from the previous lesson? Let's try to check your prior knowledge
    9·1 answer
  • Electricians will sometimes call ______ "disconnects" or a "disconnecting means."
    15·1 answer
  • Help me, iv been having problems with ads going in my phones storage files, what can i do to stop this?
    14·2 answers
  • The hydrofoil boat has an A-36 steel propeller shaft that is 100 ft long. It is connected to an in-line diesel engine that deliv
    8·1 answer
  • 1. In order to minimize hazards, what should you do before starting a job
    10·2 answers
  • What are the most used electronic tools for electronic works?​
    13·1 answer
  • Describe two other safe driver skills a driver should use when driving in this road condition
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!