author | koda |
Sun, 17 Apr 2011 22:38:24 +0200 | |
changeset 5155 | f2165724605c |
parent 4976 | 088d40d8aba2 |
child 6666 | 0e2f5b81cbf2 |
permissions | -rw-r--r-- |
3547 | 1 |
/* |
4976 | 2 |
* Hedgewars-iOS, a Hedgewars port for iOS devices |
3 |
* Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com> |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
3547 | 8 |
* |
4976 | 9 |
* This program is distributed in the hope that it will be useful, |
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
3547 | 13 |
* |
4976 | 14 |
* You should have received a copy of the GNU General Public License |
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
17 |
* |
|
18 |
* File created on 03/10/2010. |
|
3547 | 19 |
*/ |
20 |
||
4976 | 21 |
|
3547 | 22 |
#import <CoreGraphics/CoreGraphics.h> |
23 |
||
3680 | 24 |
#define degreesToRadians(x) ( M_PI * x / 180.0) |
25 |
#define radiansToDegrees(x) (180.0 * x / M_PI ) |
|
3547 | 26 |
|
3680 | 27 |
#define HWX(x) (int)(x-screen.size.height/2)/HW_zoomFactor() |
3996 | 28 |
#define HWY(x) (int)(screen.size.width-x)/HW_zoomFactor() + (IS_IPAD()?40:17.5)*HW_zoomLevel()/HW_zoomFactor() |
3680 | 29 |
|
30 |
#define HWXZ(x) (int)(x-screen.size.height/2) |
|
31 |
#define HWYZ(x) (int)(screen.size.width-x) |
|
3551 | 32 |
|
3547 | 33 |
CGFloat distanceBetweenPoints (CGPoint first, CGPoint second); |
34 |
CGFloat angleBetweenPoints(CGPoint first, CGPoint second); |
|
3680 | 35 |
CGFloat angleBetweenLines(CGPoint line1Start, CGPoint line1End, CGPoint line2Start, CGPoint line2End); |
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
3996
diff
changeset
|
36 |
|
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
3996
diff
changeset
|
37 |
CGFloat CGPointDot(CGPoint a, CGPoint b); |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
3996
diff
changeset
|
38 |
CGFloat CGPointLen(CGPoint a); |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
3996
diff
changeset
|
39 |
CGPoint CGPointSub(CGPoint a, CGPoint b); |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
3996
diff
changeset
|
40 |
CGFloat CGPointDist(CGPoint a, CGPoint b); |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
3996
diff
changeset
|
41 |
CGPoint CGPointNorm(CGPoint a); |