Skip to content
This repository was archived by the owner on May 23, 2022. It is now read-only.

Commit a07ecec

Browse files
committed
Update README.md
1 parent f6b26c7 commit a07ecec

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

Hands.playgroundbook/Edits/UserEdits.diffpack/Manifest.plist

+10-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
<key>File</key>
2525
<string>Chapters/Chapter1.playgroundchapter/UserManifest.plist</string>
2626
</dict>
27+
<dict>
28+
<key>File</key>
29+
<string>UserModules/Main.playgroundmodule/Sources/CGPoint + Extension.swift</string>
30+
</dict>
2731
</array>
2832
<key>Modified</key>
2933
<array>
@@ -35,7 +39,12 @@
3539
</dict>
3640
</array>
3741
<key>Removed</key>
38-
<array/>
42+
<array>
43+
<dict>
44+
<key>File</key>
45+
<string>UserModules/Main.playgroundmodule/Sources/CGPoint.swift</string>
46+
</dict>
47+
</array>
3948
<key>Replaced</key>
4049
<array/>
4150
</dict>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import CoreGraphics
2+
3+
extension CGPoint {
4+
5+
public func distance(from point : CGPoint) -> CGFloat {
6+
return hypot(point.x - self.x, point.y - self.y)
7+
}
8+
9+
public static func angleBetween(first: CGPoint, second: CGPoint, third: CGPoint) -> Double {
10+
let firstVector = CGVector(dx: first.x - second.x, dy: first.y - second.y)
11+
let secondVector = CGVector(dx: third.x - second.x, dy: third.y - second.y)
12+
13+
let firstTheta = atan2(firstVector.dy, firstVector.dx)
14+
let secondTheta = atan2(secondVector.dy, secondVector.dx)
15+
16+
let angle = firstTheta - secondTheta
17+
18+
return (Double(angle) * 180.0) / Double.pi
19+
}
20+
}

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ In order to determine which gesture was shown by the user, the application recog
2020

2121
I really like the new Apple SwiftUI framework for creating interfaces and its declarative style, which makes it easy to create cool interfaces, but here I decided to stop at UIKit, because I have more experience in using this technology. I also used the Vision framework to recognize the hand gestures that the user shows.
2222

23+
## Screenshots
24+
![](https://github.com/onl1ner/onl1ner/blob/master/Resources/Hands/Screenshots.png?raw=true)
25+
2326
## License
2427
**Hands** is under the terms and conditions of the MIT license.
2528

0 commit comments

Comments
 (0)