geo 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/common.h +6 -0
- data/ext/geo.c +1 -1
- data/ext/point.h +0 -3
- metadata +16 -16
data/ext/common.h
CHANGED
@@ -16,6 +16,12 @@
|
|
16
16
|
#include "point_set.h"
|
17
17
|
#include "triangle_set.h"
|
18
18
|
|
19
|
+
#ifndef M_PI
|
20
|
+
#define M_PI 3.14159265358979323846 /* pi */
|
21
|
+
#define M_PI_2 1.57079632679489661923 /* pi/2 */
|
22
|
+
#define M_PI_4 0.78539816339744830962 /* pi/4 */
|
23
|
+
#endif
|
24
|
+
|
19
25
|
//
|
20
26
|
// Utility macros.
|
21
27
|
//
|
data/ext/geo.c
CHANGED
@@ -18,7 +18,7 @@ extern "C" {
|
|
18
18
|
rb_define_method(rb_cFloat, "intlike?", rb_float_intlike, 0);
|
19
19
|
|
20
20
|
VALUE rb_geo = rb_define_module("Geo");
|
21
|
-
rb_define_const(rb_geo, "VERSION", rb_str_new2("0.1.
|
21
|
+
rb_define_const(rb_geo, "VERSION", rb_str_new2("0.1.3"));
|
22
22
|
|
23
23
|
rb_triangle_set = rb_define_class_under(rb_geo,
|
24
24
|
"TriangleSet",
|
data/ext/point.h
CHANGED
@@ -9,9 +9,6 @@ extern VALUE rb_point;
|
|
9
9
|
#define RB_POINT(point_pointer,klass) ((point_pointer)->rbPoint = Data_Wrap_Struct(klass, NULL, free, (point_pointer)))
|
10
10
|
#define POINT(rb_point,point_pointer) Data_Get_Struct((rb_point), Point, (point_pointer))
|
11
11
|
|
12
|
-
#define M_PI 3.14159265358979323846 /* pi */
|
13
|
-
#define M_PI_2 1.57079632679489661923 /* pi/2 */
|
14
|
-
#define M_PI_4 0.78539816339744830962 /* pi/4 */
|
15
12
|
#define LENGTH(dx,dy) (sqrt(pow((dx),2) + pow((dy),2)))
|
16
13
|
#define DISTANCE(p1,p2) (LENGTH((p1)->x - (p2)->x, (p1)->y - (p2)->y))
|
17
14
|
#define ANGLE(dx,dy) ((dy) > 0 ? \
|
metadata
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.
|
2
|
+
rubygems_version: 0.9.2
|
3
3
|
specification_version: 1
|
4
4
|
name: geo
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.1.
|
6
|
+
version: 0.1.3
|
7
7
|
date: 2007-12-17 00:00:00 +01:00
|
8
8
|
summary: A 2D geometry engine.
|
9
9
|
require_paths:
|
@@ -29,27 +29,27 @@ post_install_message:
|
|
29
29
|
authors:
|
30
30
|
- Martin Kihlgren
|
31
31
|
files:
|
32
|
-
- ext/
|
32
|
+
- ext/common.c
|
33
|
+
- ext/common.h
|
34
|
+
- ext/extconf.rb
|
35
|
+
- ext/geo.c
|
33
36
|
- ext/geo_set.c
|
34
|
-
- ext/
|
35
|
-
- ext/intersection.h
|
37
|
+
- ext/geo_set.h
|
36
38
|
- ext/intersection.c
|
37
|
-
- ext/
|
38
|
-
- ext/triangle.c
|
39
|
-
- ext/line_set.c
|
40
|
-
- ext/line.h
|
39
|
+
- ext/intersection.h
|
41
40
|
- ext/line.c
|
41
|
+
- ext/line.h
|
42
|
+
- ext/line_set.c
|
43
|
+
- ext/line_set.h
|
44
|
+
- ext/point.c
|
45
|
+
- ext/point.h
|
42
46
|
- ext/point_set.c
|
47
|
+
- ext/point_set.h
|
48
|
+
- ext/triangle.c
|
49
|
+
- ext/triangle.h
|
43
50
|
- ext/triangle_set.c
|
44
|
-
- ext/common.h
|
45
|
-
- ext/point.h
|
46
51
|
- ext/triangle_set.h
|
47
|
-
- ext/point_set.h
|
48
|
-
- ext/line_set.h
|
49
|
-
- ext/common.c
|
50
52
|
- ext/types.h
|
51
|
-
- ext/extconf.rb
|
52
|
-
- ext/geo.c
|
53
53
|
- examples/intersects.rb
|
54
54
|
- README
|
55
55
|
test_files: []
|