Skip to content

formula incorrect #1

@StevenJUlbrich

Description

@StevenJUlbrich

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions