Created
December 26, 2011 20:11
-
-
Save mikeash/1522029 to your computer and use it in GitHub Desktop.
Units
This file contains 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
// | |
// CWUnits.h | |
// cow | |
// | |
// Created by Michael Ash on 4/19/11. | |
// Copyright 2011 Two Pastry Eaters. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
typedef struct Parsecs | |
{ | |
double val; | |
} Parsecs; | |
typedef struct ParsecsSize | |
{ | |
Parsecs width; | |
Parsecs height; | |
} ParsecsSize; | |
typedef struct ParsecsPoint | |
{ | |
Parsecs x; | |
Parsecs y; | |
} ParsecsPoint; | |
Parsecs MakeParsecs(double val); | |
ParsecsSize MakeParsecsSize(Parsecs width, Parsecs height); | |
ParsecsPoint MakeParsecsPoint(Parsecs x, Parsecs y); | |
Parsecs ParsecsDistance(ParsecsPoint p1, ParsecsPoint p2); | |
typedef struct Kilometers | |
{ | |
double val; | |
} Kilometers; | |
Kilometers MakeKilometers(double val); | |
typedef struct Radians | |
{ | |
double val; | |
} Radians; | |
#define kMaxRadians (2 * M_PI) | |
Radians MakeRadians(double val); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment