Skip to content

Conversation

@maxruizee
Copy link

No description provided.

The Euclidean distance between the two points
"""
distance = None # Add the euclidean distance algorithm here
distance = ((b[0] - a[0])**2 + (b[1] - a[1])**2)**(1/2) # Add the euclidean distance algorithm here
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job here not using the math module. Be careful if you ever use Python 2.x, (1/2) evaluates to0, while(1.0/ 2)` would act as you would expect.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that's right, thank you.

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

Successfully merging this pull request may close these issues.

2 participants