Skip to content

Commit

Permalink
chore: update typo on code docs
Browse files Browse the repository at this point in the history
  • Loading branch information
muktihari committed Sep 16, 2024
1 parent e119a62 commit 19bbe0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rdp/rdp.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ func perpendicularDistance(p, start, end Point) float64 {
return euclidean(p, start)
}

// Standard Form: Ax + Bx + C = 0
// Standard Form: Ax + By + C = 0
A := end.Y - start.Y
B := start.X - end.X
C := start.Y*(end.X-start.X) - (end.Y-start.Y)*start.X

// d = | Ax + By + C = 0 | / ✓(A²+B²)
// d = | Ax + By + C | / ✓(A²+B²)
return math.Abs(A*p.X+B*p.Y+C) / math.Sqrt(A*A+B*B)
}

Expand Down

0 comments on commit 19bbe0b

Please sign in to comment.