Skip to content

Commit 6b3b87b

Browse files
Fix wrong math in vectorLength
The credit goes to Stefan Grothkopp for finding the bug #1522 (comment) Co-authored-by: Stefan Grothkopp <[email protected]>
1 parent 076bd42 commit 6b3b87b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/AppBundle/util/appBundleUtil.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ extension CGPoint {
109109

110110
func getProjection(_ orientation: Orientation) -> Double { orientation == .h ? x : y }
111111

112-
var vectorLength: CGFloat { sqrt(x * x - y * y) }
112+
var vectorLength: CGFloat { sqrt(x * x + y * y) }
113113

114114
func distance(to point: CGPoint) -> Double {
115115
sqrt((x - point.x).squared + (y - point.y).squared)

0 commit comments

Comments
 (0)