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
yanalaym [24]
3 years ago
5

function travelSpeed = CalculateTravelSpeed(startX, startY, endX, endY, travelTime) % startX, startY: Starting coordinates % end

X, endY: Ending coordinates % travelTime: Travel time in hours % Write an anonymous function to compute distance given two coordinates % Function name: EuclideanDist % Function inputs: x1, y1, x2, y2 % EuclideanDist = ... % Do not modify the statement below travelSpeed = EuclideanDist(startX, startY, endX, endY) / travelTime; end
Mathematics
1 answer:
Ilia_Sergeevich [38]3 years ago
5 0

Answer:

The functions in Python is as follows:

from math import *

def CalculateTravelSpeed(startX,startY,endX,endY,travelTime):

   travelSpeed = EuclideanDist(startX, startY, endX, endY) / travelTime

   return travelSpeed

def EuclideanDist(startX, startY, endX, endY):

   dist = sqrt((startX - endX)**2 + (startY - endY)**2)

   return dist

Step-by-step explanation:

from math import *

This defines the CalculateTravelSpeed function

def CalculateTravelSpeed(startX,startY,endX,endY,travelTime):

This calls the EuclideanDist function to calculate the distance; Next, the speed is calculated

   travelSpeed = EuclideanDist(startX, startY, endX, endY) / travelTime

This returns the calculated speed

   return travelSpeed

This defines the EuclideanDist function

def EuclideanDist(startX, startY, endX, endY):

This calculates the distance from the given coordinates

   dist = sqrt((startX - endX)**2 + (startY - endY)**2)

This returns the calculated distance

   return dist

You might be interested in
Explain why you can remove an x-tile from each side of the mat
wariber [46]

Step-by-step explanation:

because as long as you do the same thing on both sides it remains the same

8 0
4 years ago
You have the following expenses: clothes—$98.95, utilities—$234.98, rent—$875.34, and groceries—$103.98. Which expenses are disc
Furkat [3]
Utilities and groceries
7 0
3 years ago
Read 2 more answers
Calculate the following sum : (3/20) + (4/15).
vichka [17]
(3/20) x 3 (4/15) x4
9/60 + 12/60
= 21/60
=7/20
6 0
4 years ago
Julio bought a total of 20 medium and large pumpkins. If he spent $53 and bought 6 more large pumpkins as medium pumpkins, how m
Zinaida [17]
Medium- 20
large- 20
6×20=120
Answer-120 large pumpkins
5 0
4 years ago
Megan and Suzanne each have a plant. They track the growth of their plants for four weeks.
Vikki [24]

Answer:

Megan’s at 2.5 inches per week

3 0
3 years ago
Other questions:
  • (Please show steps)<br> Graph the logarithmic function y=log(x-2)
    9·2 answers
  • How much 0.144 divide 0.96
    10·2 answers
  • At a certain excavation site, archaeological studies have used the method of tree-ring dating in an effort to determine when peo
    11·1 answer
  • What is the difference between rational and irrational numbers
    13·2 answers
  • In one​ lottery, a player wins the jackpot by matching all five numbers drawn from white balls​ (1 through 45​) and matching the
    9·1 answer
  • If f(x) = x-5 and g(x) = 3x2-1,<br> what is (fºg)(x)?
    9·1 answer
  • Pls help willing to give brainiest
    12·1 answer
  • What is the mean of 6 and 4
    10·2 answers
  • Graph the line that represents this equation:y=-2/3x +1
    11·2 answers
  • Can someone help me pls
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!