This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // YObservable | |
| // ZKit | |
| // | |
| // The MIT License (MIT) | |
| // | |
| // Copyright (c) 2016 Electricwoods LLC, Kaz Yoshikawa. | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // FileHandle+Z.swift | |
| // ZKit | |
| // | |
| // The MIT License (MIT) | |
| // | |
| // Copyright (c) 2016 Electricwoods LLC, Kaz Yoshikawa. | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // ZDownloader.swift | |
| // ZKit | |
| // | |
| // The MIT License (MIT) | |
| // | |
| // Copyright (c) 2016 Electricwoods LLC, Kaz Yoshikawa. | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // ZType.swift | |
| // ZKit [swift 3] | |
| // | |
| // The MIT License (MIT) | |
| // | |
| // Copyright (c) 2016 Electricwoods LLC, Kaz Yoshikawa. | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // Sequence+Z.swift | |
| // ZKit [Swift 5] | |
| // | |
| // The MIT License (MIT) | |
| // | |
| // Copyright (c) 2019 Electricwoods LLC, Kaz Yoshikawa. | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // GeoUtils.swift | |
| // ZKit | |
| // | |
| // The MIT License (MIT) | |
| // | |
| // Copyright (c) 2016 Electricwoods LLC, Kaz Yoshikawa. | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // MTLTexture+Z.swift | |
| // ZKit | |
| // | |
| // The MIT License (MIT) | |
| // | |
| // Copyright (c) 2016 Electricwoods LLC, Kaz Yoshikawa. | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| typealias Point = ( | |
| touchType: Int, location: (CGFloat, CGFloat), preciseLocation: (CGFloat, CGFloat), majorRadius: CGFloat, majorRadiusTolerance: CGFloat, timestamp: TimeInterval, | |
| force: CGFloat, maximumPossibleForce: CGFloat, altitudeAngle: CGFloat, azimuthAngle: CGFloat, azimuthUnitVector: (CGFloat, CGFloat) | |
| ) | |
| [[ Point(2, (355.03125, 684.459045410156), (355.03125, 684.459045410156), 0.25, 0.0, 0.0, 0.333333333333333,4.16666666666667, 0.793895081677709, 1.04037475585938, (0.505897030655754, 0.862593875687563)), | |
| Point(2, (355.296875, 683.854614257812), (355.296875, 683.854614257812), 0.25, 0.0, 0.0129999999990105, 0.2078125,4.16666666666667, 0.793895081677709, 1.04037475585938, (0.505897030655754, 0.862593875687563)), | |
| Point(2, (355.5625, 683.39599609375), (355.5625, 683.39599609375), 0.25, 0.0, 0.0169999999998254, 0.145052083333333,4.16666666666667, 0.793895081677709, 1.04037475585938, (0.505897030655754, 0.862593875687563)), | |
| Point(2, (355.703125, 683.125061035156), (355.703125, 683.125061035156), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func quadraticBezierLength(_ p0: CGPoint, _ p1: CGPoint, _ p2: CGPoint) -> CGFloat { | |
| // cf. http://www.malczak.linuxpl.com/blog/quadratic-bezier-curve-length/ | |
| let a = CGPoint(p0.x - 2 * p1.x + p2.x, p0.y - 2 * p1.y + p2.y) | |
| let b = CGPoint(2 * p1.x - 2 * p0.x, 2 * p1.y - 2 * p0.y) | |
| let A = 4 * (a.x * a.x + a.y * a.y) | |
| let B = 4 * (a.x * b.x + a.y * b.y) | |
| let C = b.x * b.x + b.y * b.y | |
| let Sabc = 2 * sqrt(A + B + C) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // XPlatform.swift | |
| // XPlatform | |
| // | |
| // Created by Kaz Yoshikawa on 12/25/16. | |
| // Copyright © 2017 Electricwoods LLC. All rights reserved. | |
| // | |
| import Foundation |