Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formula incorrect #1

Open
StevenJUlbrich opened this issue Aug 29, 2021 · 1 comment
Open

formula incorrect #1

StevenJUlbrich opened this issue Aug 29, 2021 · 1 comment

Comments

@StevenJUlbrich
Copy link

def get_distance_between_points(first, second):
(x1, y1) = first
(x2, y2) = second

x_diff = x2 - x1
y_diff = y2 - y1

return math.sqrt(x_diff * x_diff + y_diff * y_diff)  #wrong

return math.sqrt((x_diff**2) + (y_diff**2))  #proper
@SivaRamana-H-V
Copy link

Without using math

x = x2 - x1
y = y2 - y1

return math.sqrt(x * x + y* y)  #wrong

return ( ( ( x**2 )**0.5 ) + ( y**2 )**0.5 )

jainsau pushed a commit to jainsau/deep_racer_framework that referenced this issue Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants