-
Notifications
You must be signed in to change notification settings - Fork 1
/
KKVector.h
executable file
·42 lines (35 loc) · 918 Bytes
/
KKVector.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
42
//
// KKVector.h
// TouchBattle
//
// Created by keitanxkeitan on 11/08/26.
// Copyright 2011 keitanxkeitan. All rights reserved.
//
#import "math.h"
@interface KKVector : NSObject {
@private
CGFloat x_, y_;
}
@property (assign, readwrite) CGFloat x;
@property (assign, readwrite) CGFloat y;
+ (KKVector *)vector;
+ (KKVector *)vectorWithPoint:(CGPoint)point;
- (id)init;
- (id)initWithPoint:(CGPoint)point;
- (KKVector *)set:(CGPoint)point;
- (KKVector *)clone;
- (KKVector *)add:(KKVector *)v;
- (KKVector *)sub:(KKVector *)v;
- (CGFloat)scalar:(KKVector *)v;
- (CGFloat)cross:(KKVector *)v;
- (KKVector *)scale:(CGFloat)n;
- (KKVector *)normalize;
- (KKVector *)resize:(CGFloat)n;
- (KKVector *)rotate:(CGFloat)deg;
- (KKVector *)reverse;
- (KKVector *)zero;
- (KKVector *)max:(CGFloat)max;
- (KKVector *)min:(CGFloat)min;
@property (readonly) CGFloat length;
@property (readonly) CGFloat angle;
@end