forked from heycarsten/haversine-objc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Haversine.h
41 lines (33 loc) · 820 Bytes
/
Haversine.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// haversine.h
//
// Created by Carsten Nielsen on 23/04/09.
//
#import <Foundation/Foundation.h>
extern float const HAVERSINE_RADS_PER_DEGREE;
extern float const HAVERSINE_MI_RADIUS;
extern float const HAVERSINE_KM_RADIUS;
extern float const HAVERSINE_M_PER_KM;
extern float const HAVERSINE_F_PER_MI;
@interface Haversine : NSObject {
float lat1;
float lon1;
float lat2;
float lon2;
}
@property float lat1;
@property float lon1;
@property float lat2;
@property float lon2;
+ (float)distanceFromPoint:(CGPoint)firstPoint toPoint:(CGPoint)lastPoint;
- (id)init;
- (id)initWithLat1:(float)newLat1
lon1:(float)newLon1
lat2:(float)newLat2
lon2:(float)newLon2;
- (float)distance;
- (float)toKilometers;
- (float)toMeters;
- (float)toMiles;
- (float)toFeet;
@end