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
// | |
// NSString+StringExtensions.h | |
// StringFunctions | |
// | |
// Created by Geoff Armstrong on 10/29/15. | |
// Copyright © 2015 Geoff Armstrong. All rights reserved. | |
// | |
#ifndef NSString_StringExtensions_h | |
#define NSString_StringExtensions_h |
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
// | |
// NSInteger+NSIntegerExtensions.h | |
// IntegerFunctions | |
// | |
// Created by Geoff Armstrong on 10/30/15. | |
// Copyright © 2015 Geoff Armstrong. All rights reserved. | |
// | |
#ifndef NSNumber_NSNumberExtensions_h | |
#define NSNumber_NSNumberExtensions_h |
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
// | |
// GSABinaryTree.h | |
// BinaryTree | |
// | |
// Created by Geoff Armstrong on 11/3/15. | |
// Copyright © 2015 Geoff Armstrong. All rights reserved. | |
// | |
#ifndef GSABinaryTree_h | |
#define GSABinaryTree_h |
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
// | |
// NSArray+NSArrayExtensions.h | |
// ArrayFunctions | |
// | |
// Created by Geoff Armstrong on 11/4/15. | |
// Copyright © 2015 Geoff Armstrong. All rights reserved. | |
// | |
#ifndef NSArray_NSArrayExtensions_h | |
#define NSArray_NSArrayExtensions_h |
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
/** | |
Calculates the pitch angle for the device based on it's orientation from the Quaternion | |
- parameter quat: The Quaternary from CMMotionManager.attitude | |
- returns: pitch The pitch of the device, scaled so that vertical is 0 degrees | |
*/ | |
private func pitchFromQuaternion(quat: CMQuaternion) -> Double { | |
// http://stackoverflow.com/questions/9478630/get-pitch-yaw-roll-from-a-cmrotationmatrix/18764368#18764368 | |
//let degRoll = radiansToDegrees(atan2(2*(quat.y*quat.w - quat.x*quat.z), 1 - 2*quat.y*quat.y - 2*quat.z*quat.z)) |
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
/** | |
Calculate the x-pixel offset for an angle | |
- parameter angle: The viewing angle for the object | |
- returns: xOffset CGFloat for the x location of the object on the screen | |
*/ | |
private func getXPixelOffset(angle: Double) -> CGFloat { | |
var xOffset = CGFloat(0.0) |
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
/** | |
Calculate the x-pixel offset for an angle using perspective projection | |
http://stackoverflow.com/questions/16619104/perspective-projection-in-android-in-an-augmented-reality-application | |
- parameter angle: The viewing angle for the object | |
- returns: xOffset CGFloat for the x location of the object on the screen | |
*/ | |
private func getXPerspectiveOffset(angle: Double) -> CGFloat { |
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
/** | |
Calculate initial compass bearing between two locations | |
- parameter fromLocation: Source Location | |
- parameter toLocation: Destination Location | |
- returns: bearing (CLLocationDirection) | |
*/ | |
private func bearingFromLocation(fromLocation: CLLocation, toLocation: CLLocation) -> CLLocationDirection { | |
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
// | |
// ViewController.swift | |
// | |
// Created by Geoff Armstrong on 3/31/15. | |
// Copyright (c) 2015 Geoff Armstrong. All rights reserved. | |
// | |
import UIKit | |
class ViewController: UIViewController { |
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
// | |
// JsonHandler.swift | |
// | |
// Created by Geoff Armstrong on 4/6/15. | |
// Copyright (c) 2015 Geoff Armstrong. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
NewerOlder