Loading...
Searching...
No Matches
GeometryUtilsExample.m
Go to the documentation of this file.
2
7@implementation GeometryUtilsExample
8
9- (instancetype)init {
10 self = [super init];
11 if (self) {
13 }
14 return self;
15}
16
21 NSLog(@"=== GeometryUtils Methods ===");
22
23 [self demonstratePointOperations];
24 [self demonstrateGlobalPointOperations];
25 [self demonstrateSegmentOperations];
26 [self demonstratePolygonOperations];
27 [self demonstrateLineOperations];
28 [self demonstrateAdvancedGeometryOperations];
29}
30
34- (void)demonstratePointOperations {
35 NSLog(@"--- Point Operations ---");
36
37 // [objc_Point_constructor]
38 // Create points with x, y coordinates
39 NCPoint *point1 = [[NCPoint alloc] initWithX:10.0 y:20.0];
40 NCPoint *point2 = [[NCPoint alloc] initWithX:30.0 y:40.0];
41 NCPoint *point3 = [[NCPoint alloc] initWithX:50.0 y:60.0];
42 NSLog(@"Created points: P1(%.1f, %.1f), P2(%.1f, %.1f), P3(%.1f, %.1f)",
43 point1.x, point1.y, point2.x, point2.y, point3.x, point3.y);
44 // [objc_Point_constructor]
45
46 // [objc_Point_getX]
47 // Get X coordinate
48 double x1 = point1.x;
49 NSLog(@"Point1 X coordinate: %.1f", x1);
50 // [objc_Point_getX]
51
52 // [objc_Point_getY]
53 // Get Y coordinate
54 double y1 = point1.y;
55 NSLog(@"Point1 Y coordinate: %.1f", y1);
56 // [objc_Point_getY]
57
58 // [objc_GeometryUtils_distanceBetweenPoints]
59 // Calculate distance between points
60 double distance = [NCGeometryUtils distanceBetweenPointsWithFrom:point1 to:point2];
61 NSLog(@"Distance between P1 and P2: %.2f meters", distance);
62 // [objc_GeometryUtils_distanceBetweenPoints]
63
64 // Create more points for testing
65 NSArray<NCPoint *> *testPoints = @[
66 [[NCPoint alloc] initWithX:0.0 y:0.0],
67 [[NCPoint alloc] initWithX:10.0 y:0.0],
68 [[NCPoint alloc] initWithX:10.0 y:10.0],
69 [[NCPoint alloc] initWithX:0.0 y:10.0],
70 [[NCPoint alloc] initWithX:5.0 y:5.0]
71 ];
72
73 NSLog(@"Test points created for further calculations");
74}
75
79- (void)demonstrateGlobalPointOperations {
80 NSLog(@"--- GlobalPoint Operations ---");
81
82 // [objc_GlobalPoint_constructor]
83 // Create global points with latitude, longitude
84 NCGlobalPoint *globalPoint1 = [[NCGlobalPoint alloc] initWithLatitude:55.7558 longitude:37.6176]; // Moscow
85 NCGlobalPoint *globalPoint2 = [[NCGlobalPoint alloc] initWithLatitude:59.9311 longitude:30.3609]; // St. Petersburg
86 NCGlobalPoint *globalPoint3 = [[NCGlobalPoint alloc] initWithLatitude:55.7522 longitude:37.6156]; // Moscow center
87 NSLog(@"Created global points: GP1(%.4f, %.4f), GP2(%.4f, %.4f)",
88 globalPoint1.latitude, globalPoint1.longitude, globalPoint2.latitude, globalPoint2.longitude);
89 // [objc_GlobalPoint_constructor]
90
91 // [objc_GlobalPoint_getLatitude]
92 // Get latitude
93 double lat1 = globalPoint1.latitude;
94 NSLog(@"GlobalPoint1 latitude: %.4f", lat1);
95 // [objc_GlobalPoint_getLatitude]
96
97 // [objc_GlobalPoint_getLongitude]
98 // Get longitude
99 double lon1 = globalPoint1.longitude;
100 NSLog(@"GlobalPoint1 longitude: %.4f", lon1);
101 // [objc_GlobalPoint_getLongitude]
102
103 // [objc_GeometryUtils_distanceBetweenGlobalPoints]
104 // Calculate distance between global points
105 double globalDistance = [NCGeometryUtils distanceBetweenGlobalPointsWithFrom:globalPoint1 to:globalPoint2];
106 NSLog(@"Distance between Moscow and St. Petersburg: %.2f meters", globalDistance);
107 // [objc_GeometryUtils_distanceBetweenGlobalPoints]
108
109 // Calculate distance between nearby points
110 double nearbyDistance = [NCGeometryUtils distanceBetweenGlobalPointsWithFrom:globalPoint1 to:globalPoint3];
111 NSLog(@"Distance between Moscow points: %.2f meters", nearbyDistance);
112}
113
117- (void)demonstrateSegmentOperations {
118 NSLog(@"--- Segment Operations ---");
119
120 // Create points for segments
121 NCPoint *start1 = [[NCPoint alloc] initWithX:0.0 y:0.0];
122 NCPoint *end1 = [[NCPoint alloc] initWithX:10.0 y:10.0];
123 NCPoint *start2 = [[NCPoint alloc] initWithX:0.0 y:10.0];
124 NCPoint *end2 = [[NCPoint alloc] initWithX:10.0 y:0.0];
125 NCPoint *testPoint = [[NCPoint alloc] initWithX:5.0 y:5.0];
126
127 // [objc_Segment_constructor]
128 // Create segments
129 NCSegment *segment1 = [[NCSegment alloc] initWithStart:start1 end:end1];
130 NCSegment *segment2 = [[NCSegment alloc] initWithStart:start2 end:end2];
131 NSLog(@"Created segments: S1((%.1f, %.1f) -> (%.1f, %.1f)), S2((%.1f, %.1f) -> (%.1f, %.1f))",
132 segment1.start.x, segment1.start.y, segment1.end.x, segment1.end.y,
133 segment2.start.x, segment2.start.y, segment2.end.x, segment2.end.y);
134 // [objc_Segment_constructor]
135
136 // [objc_Segment_getStart]
137 // Get start point
138 NCPoint *segment1Start = segment1.start;
139 NSLog(@"Segment1 start point: (%.1f, %.1f)", segment1Start.x, segment1Start.y);
140 // [objc_Segment_getStart]
141
142 // [objc_Segment_getEnd]
143 // Get end point
144 NCPoint *segment1End = segment1.end;
145 NSLog(@"Segment1 end point: (%.1f, %.1f)", segment1End.x, segment1End.y);
146 // [objc_Segment_getEnd]
147
148 // [objc_GeometryUtils_segmentLength]
149 // Calculate segment length
150 double length1 = [NCGeometryUtils segmentLengthWithSegment:segment1];
151 double length2 = [NCGeometryUtils segmentLengthWithSegment:segment2];
152 NSLog(@"Segment1 length: %.2f meters", length1);
153 NSLog(@"Segment2 length: %.2f meters", length2);
154 // [objc_GeometryUtils_segmentLength]
155
156 // [objc_GeometryUtils_segmentPointDistance]
157 // Calculate distance from segment to point
158 double distanceToPoint = [NCGeometryUtils segmentPointDistanceWithSegment:segment1 point:testPoint];
159 NSLog(@"Distance from segment1 to test point: %.2f meters", distanceToPoint);
160 // [objc_GeometryUtils_segmentPointDistance]
161
162 // [objc_GeometryUtils_segmentIntersectsSegment]
163 // Check if segments intersect
164 BOOL intersects = [NCGeometryUtils segmentIntersectsSegmentWithSegment1:segment1 segment2:segment2];
165 NSLog(@"Segments intersect: %@", intersects ? @"YES" : @"NO");
166 // [objc_GeometryUtils_segmentIntersectsSegment]
167
168 // [objc_GeometryUtils_segmentIntersectionSegment]
169 // Calculate intersection point
170 NCPoint *intersection = [NCGeometryUtils segmentIntersectionSegmentWithSegment1:segment1 segment2:segment2];
171 NSLog(@"Intersection point: (%.2f, %.2f)", intersection.x, intersection.y);
172 // [objc_GeometryUtils_segmentIntersectionSegment]
173
174 // [objc_GeometryUtils_divisionRatioBySegment]
175 // Calculate division ratio
176 double divisionRatio = [NCGeometryUtils divisionRatioBySegmentWithSegment1:segment1 segment2:segment2];
177 NSLog(@"Division ratio: %.2f", divisionRatio);
178 // [objc_GeometryUtils_divisionRatioBySegment]
179
180 // [objc_GeometryUtils_getRatioPoint]
181 // Get point at specific ratio
182 double ratio = 0.5;
183 NCPoint *ratioPoint = [NCGeometryUtils getRatioPointWithSegment:segment1 r:ratio];
184 NSLog(@"Point at ratio %.1f: (%.2f, %.2f)", ratio, ratioPoint.x, ratioPoint.y);
185 // [objc_GeometryUtils_getRatioPoint]
186
187 // [objc_GeometryUtils_getProjectionRatio]
188 // Calculate projection ratio
189 double projectionRatio = [NCGeometryUtils getProjectionRatioWithSegment:segment1 point:testPoint];
190 NSLog(@"Projection ratio: %.2f", projectionRatio);
191 // [objc_GeometryUtils_getProjectionRatio]
192}
193
197- (void)demonstratePolygonOperations {
198 NSLog(@"--- Polygon Operations ---");
199
200 // Create points for polygon
201 NSArray<NCPoint *> *polygonPoints = @[
202 [[NCPoint alloc] initWithX:0.0 y:0.0],
203 [[NCPoint alloc] initWithX:10.0 y:0.0],
204 [[NCPoint alloc] initWithX:10.0 y:10.0],
205 [[NCPoint alloc] initWithX:0.0 y:10.0]
206 ];
207
208 // [objc_Polygon_constructor]
209 // Create polygon
210 NCPolygon *polygon = [[NCPolygon alloc] initWithPoints:polygonPoints];
211 NSLog(@"Created polygon with %lu points", (unsigned long)polygon.points.count);
212 // [objc_Polygon_constructor]
213
214 // [objc_Polygon_getPoints]
215 // Get polygon points
216 NSArray<NCPoint *> *points = polygon.points;
217 NSMutableString *pointsString = [NSMutableString string];
218 for (NCPoint *point in points) {
219 if (pointsString.length > 0) {
220 [pointsString appendString:@", "];
221 }
222 [pointsString appendFormat:@"(%.1f, %.1f)", point.x, point.y];
223 }
224 NSLog(@"Polygon points: %@", pointsString);
225 // [objc_Polygon_getPoints]
226
227 // [objc_GeometryUtils_polygonArea]
228 // Calculate polygon area
229 double area = [NCGeometryUtils polygonAreaWithPolygon:polygon];
230 NSLog(@"Polygon area: %.2f square meters", area);
231 // [objc_GeometryUtils_polygonArea]
232
233 // [objc_GeometryUtils_polygonCenter]
234 // Calculate polygon center
235 NCPoint *center = [NCGeometryUtils polygonCenterWithPolygon:polygon];
236 NSLog(@"Polygon center: (%.2f, %.2f)", center.x, center.y);
237 // [objc_GeometryUtils_polygonCenter]
238
239 // [objc_GeometryUtils_polygonContainsPoint]
240 // Check if polygon contains point
241 NCPoint *insidePoint = [[NCPoint alloc] initWithX:5.0 y:5.0];
242 NCPoint *outsidePoint = [[NCPoint alloc] initWithX:15.0 y:15.0];
243
244 BOOL containsInside = [NCGeometryUtils polygonContainsPointWithPolygon:polygon point:insidePoint];
245 BOOL containsOutside = [NCGeometryUtils polygonContainsPointWithPolygon:polygon point:outsidePoint];
246
247 NSLog(@"Polygon contains inside point: %@", containsInside ? @"YES" : @"NO");
248 NSLog(@"Polygon contains outside point: %@", containsOutside ? @"YES" : @"NO");
249 // [objc_GeometryUtils_polygonContainsPoint]
250
251 // Create complex polygon
252 NSArray<NCPoint *> *complexPolygonPoints = @[
253 [[NCPoint alloc] initWithX:0.0 y:0.0],
254 [[NCPoint alloc] initWithX:20.0 y:0.0],
255 [[NCPoint alloc] initWithX:20.0 y:20.0],
256 [[NCPoint alloc] initWithX:10.0 y:10.0],
257 [[NCPoint alloc] initWithX:0.0 y:20.0]
258 ];
259 NCPolygon *complexPolygon = [[NCPolygon alloc] initWithPoints:complexPolygonPoints];
260
261 double complexArea = [NCGeometryUtils polygonAreaWithPolygon:complexPolygon];
262 NCPoint *complexCenter = [NCGeometryUtils polygonCenterWithPolygon:complexPolygon];
263
264 NSLog(@"Complex polygon area: %.2f square meters", complexArea);
265 NSLog(@"Complex polygon center: (%.2f, %.2f)", complexCenter.x, complexCenter.y);
266}
267
271- (void)demonstrateLineOperations {
272 NSLog(@"--- Line Operations ---");
273
274 // Create segments for line
275 NSArray<NCSegment *> *lineSegments = @[
276 [[NCSegment alloc] initWithStart:[[NCPoint alloc] initWithX:0.0 y:0.0]
277 end:[[NCPoint alloc] initWithX:10.0 y:10.0]],
278 [[NCSegment alloc] initWithStart:[[NCPoint alloc] initWithX:10.0 y:10.0]
279 end:[[NCPoint alloc] initWithX:20.0 y:5.0]],
280 [[NCSegment alloc] initWithStart:[[NCPoint alloc] initWithX:20.0 y:5.0]
281 end:[[NCPoint alloc] initWithX:30.0 y:15.0]]
282 ];
283
284 // [objc_Line_constructor]
285 // Create line
286 NCLine *line = [[NCLine alloc] initWithSegments:lineSegments];
287 NSLog(@"Created line with %lu segments", (unsigned long)line.segments.count);
288 // [objc_Line_constructor]
289
290 // [objc_Line_getSegments]
291 // Get line segments
292 NSArray<NCSegment *> *segments = line.segments;
293 NSLog(@"Line segments: %lu segments", (unsigned long)segments.count);
294 // [objc_Line_getSegments]
295
296 // Calculate total length of line
297 double totalLength = 0.0;
298 for (NCSegment *segment in segments) {
299 totalLength += [NCGeometryUtils segmentLengthWithSegment:segment];
300 }
301 NSLog(@"Total line length: %.2f meters", totalLength);
302
303 // Create complex line
304 NSArray<NCSegment *> *complexLineSegments = @[
305 [[NCSegment alloc] initWithStart:[[NCPoint alloc] initWithX:0.0 y:0.0]
306 end:[[NCPoint alloc] initWithX:5.0 y:5.0]],
307 [[NCSegment alloc] initWithStart:[[NCPoint alloc] initWithX:5.0 y:5.0]
308 end:[[NCPoint alloc] initWithX:10.0 y:0.0]],
309 [[NCSegment alloc] initWithStart:[[NCPoint alloc] initWithX:10.0 y:0.0]
310 end:[[NCPoint alloc] initWithX:15.0 y:10.0]],
311 [[NCSegment alloc] initWithStart:[[NCPoint alloc] initWithX:15.0 y:10.0]
312 end:[[NCPoint alloc] initWithX:20.0 y:5.0]]
313 ];
314 NCLine *complexLine = [[NCLine alloc] initWithSegments:complexLineSegments];
315
316 double complexTotalLength = 0.0;
317 for (NCSegment *segment in complexLine.segments) {
318 complexTotalLength += [NCGeometryUtils segmentLengthWithSegment:segment];
319 }
320 NSLog(@"Complex line total length: %.2f meters", complexTotalLength);
321}
322
326- (void)demonstrateAdvancedGeometryOperations {
327 NSLog(@"--- Advanced Geometry Operations ---");
328
329 // Test distance calculations with various scenarios
330 [self demonstrateDistanceCalculations];
331
332 // Test intersection scenarios
333 [self demonstrateIntersectionScenarios];
334
335 // Test polygon operations with different shapes
336 [self demonstratePolygonScenarios];
337
338 // Test projection and ratio calculations
339 [self demonstrateProjectionCalculations];
340}
341
345- (void)demonstrateDistanceCalculations {
346 NSLog(@"--- Distance Calculations ---");
347
348 // Test point distances
349 NCPoint *origin = [[NCPoint alloc] initWithX:0.0 y:0.0];
350 NSArray<NCPoint *> *testPoints = @[
351 [[NCPoint alloc] initWithX:3.0 y:4.0], // Should be 5.0 distance
352 [[NCPoint alloc] initWithX:6.0 y:8.0], // Should be 10.0 distance
353 [[NCPoint alloc] initWithX:1.0 y:1.0] // Should be sqrt(2) distance
354 ];
355
356 for (NCPoint *testPoint in testPoints) {
357 double distance = [NCGeometryUtils distanceBetweenPointsWithFrom:origin to:testPoint];
358 NSLog(@"Distance from origin to (%.1f, %.1f): %.2f meters", testPoint.x, testPoint.y, distance);
359 }
360
361 // Test global point distances
362 NCGlobalPoint *moscow = [[NCGlobalPoint alloc] initWithLatitude:55.7558 longitude:37.6176];
363 NCGlobalPoint *london = [[NCGlobalPoint alloc] initWithLatitude:51.5074 longitude:-0.1278];
364 NCGlobalPoint *tokyo = [[NCGlobalPoint alloc] initWithLatitude:35.6762 longitude:139.6503];
365
366 double moscowLondon = [NCGeometryUtils distanceBetweenGlobalPointsWithFrom:moscow to:london];
367 double moscowTokyo = [NCGeometryUtils distanceBetweenGlobalPointsWithFrom:moscow to:tokyo];
368
369 NSLog(@"Moscow to London: %.2f km", moscowLondon / 1000);
370 NSLog(@"Moscow to Tokyo: %.2f km", moscowTokyo / 1000);
371}
372
376- (void)demonstrateIntersectionScenarios {
377 NSLog(@"--- Intersection Scenarios ---");
378
379 // Parallel segments (should not intersect)
380 NCSegment *parallel1 = [[NCSegment alloc] initWithStart:[[NCPoint alloc] initWithX:0.0 y:0.0]
381 end:[[NCPoint alloc] initWithX:10.0 y:0.0]];
382 NCSegment *parallel2 = [[NCSegment alloc] initWithStart:[[NCPoint alloc] initWithX:0.0 y:5.0]
383 end:[[NCPoint alloc] initWithX:10.0 y:5.0]];
384
385 BOOL parallelIntersects = [NCGeometryUtils segmentIntersectsSegmentWithSegment1:parallel1 segment2:parallel2];
386 NSLog(@"Parallel segments intersect: %@", parallelIntersects ? @"YES" : @"NO");
387
388 // Perpendicular segments (should intersect)
389 NCSegment *perpendicular1 = [[NCSegment alloc] initWithStart:[[NCPoint alloc] initWithX:0.0 y:0.0]
390 end:[[NCPoint alloc] initWithX:10.0 y:0.0]];
391 NCSegment *perpendicular2 = [[NCSegment alloc] initWithStart:[[NCPoint alloc] initWithX:5.0 y:-5.0]
392 end:[[NCPoint alloc] initWithX:5.0 y:5.0]];
393
394 BOOL perpendicularIntersects = [NCGeometryUtils segmentIntersectsSegmentWithSegment1:perpendicular1 segment2:perpendicular2];
395 NSLog(@"Perpendicular segments intersect: %@", perpendicularIntersects ? @"YES" : @"NO");
396
397 if (perpendicularIntersects) {
398 NCPoint *intersection = [NCGeometryUtils segmentIntersectionSegmentWithSegment1:perpendicular1 segment2:perpendicular2];
399 NSLog(@"Intersection point: (%.2f, %.2f)", intersection.x, intersection.y);
400 }
401
402 // Overlapping segments
403 NCSegment *overlap1 = [[NCSegment alloc] initWithStart:[[NCPoint alloc] initWithX:0.0 y:0.0]
404 end:[[NCPoint alloc] initWithX:10.0 y:0.0]];
405 NCSegment *overlap2 = [[NCSegment alloc] initWithStart:[[NCPoint alloc] initWithX:5.0 y:0.0]
406 end:[[NCPoint alloc] initWithX:15.0 y:0.0]];
407
408 BOOL overlapIntersects = [NCGeometryUtils segmentIntersectsSegmentWithSegment1:overlap1 segment2:overlap2];
409 NSLog(@"Overlapping segments intersect: %@", overlapIntersects ? @"YES" : @"NO");
410}
411
415- (void)demonstratePolygonScenarios {
416 NSLog(@"--- Polygon Scenarios ---");
417
418 // Regular square
419 NSArray<NCPoint *> *square = @[
420 [[NCPoint alloc] initWithX:0.0 y:0.0],
421 [[NCPoint alloc] initWithX:10.0 y:0.0],
422 [[NCPoint alloc] initWithX:10.0 y:10.0],
423 [[NCPoint alloc] initWithX:0.0 y:10.0]
424 ];
425 NCPolygon *squarePolygon = [[NCPolygon alloc] initWithPoints:square];
426
427 double squareArea = [NCGeometryUtils polygonAreaWithPolygon:squarePolygon];
428 NCPoint *squareCenter = [NCGeometryUtils polygonCenterWithPolygon:squarePolygon];
429
430 NSLog(@"Square area: %.2f square meters", squareArea);
431 NSLog(@"Square center: (%.2f, %.2f)", squareCenter.x, squareCenter.y);
432
433 // Triangle
434 NSArray<NCPoint *> *triangle = @[
435 [[NCPoint alloc] initWithX:0.0 y:0.0],
436 [[NCPoint alloc] initWithX:10.0 y:0.0],
437 [[NCPoint alloc] initWithX:5.0 y:10.0]
438 ];
439 NCPolygon *trianglePolygon = [[NCPolygon alloc] initWithPoints:triangle];
440
441 double triangleArea = [NCGeometryUtils polygonAreaWithPolygon:trianglePolygon];
442 NCPoint *triangleCenter = [NCGeometryUtils polygonCenterWithPolygon:trianglePolygon];
443
444 NSLog(@"Triangle area: %.2f square meters", triangleArea);
445 NSLog(@"Triangle center: (%.2f, %.2f)", triangleCenter.x, triangleCenter.y);
446
447 // Test point containment
448 NCPoint *insideSquare = [[NCPoint alloc] initWithX:5.0 y:5.0];
449 NCPoint *outsideSquare = [[NCPoint alloc] initWithX:15.0 y:15.0];
450
451 BOOL containsInside = [NCGeometryUtils polygonContainsPointWithPolygon:squarePolygon point:insideSquare];
452 BOOL containsOutside = [NCGeometryUtils polygonContainsPointWithPolygon:squarePolygon point:outsideSquare];
453
454 NSLog(@"Square contains (5,5): %@", containsInside ? @"YES" : @"NO");
455 NSLog(@"Square contains (15,15): %@", containsOutside ? @"YES" : @"NO");
456}
457
461- (void)demonstrateProjectionCalculations {
462 NSLog(@"--- Projection Calculations ---");
463
464 NCSegment *segment = [[NCSegment alloc] initWithStart:[[NCPoint alloc] initWithX:0.0 y:0.0]
465 end:[[NCPoint alloc] initWithX:10.0 y:10.0]];
466
467 // Test different ratio points
468 NSArray<NSNumber *> *ratios = @[@0.0, @0.25, @0.5, @0.75, @1.0];
469
470 for (NSNumber *ratioNumber in ratios) {
471 double ratio = ratioNumber.doubleValue;
472 NCPoint *ratioPoint = [NCGeometryUtils getRatioPointWithSegment:segment r:ratio];
473 NSLog(@"Ratio %.2f: (%.2f, %.2f)", ratio, ratioPoint.x, ratioPoint.y);
474 }
475
476 // Test projection ratio calculation
477 NCPoint *testPoint = [[NCPoint alloc] initWithX:5.0 y:5.0];
478 double projectionRatio = [NCGeometryUtils getProjectionRatioWithSegment:segment point:testPoint];
479 NSLog(@"Projection ratio for point (5,5): %.2f", projectionRatio);
480
481 // Test distance from segment to point
482 NCPoint *offSegmentPoint = [[NCPoint alloc] initWithX:5.0 y:0.0];
483 double distanceToOffPoint = [NCGeometryUtils segmentPointDistanceWithSegment:segment point:offSegmentPoint];
484 NSLog(@"Distance from segment to point (5,0): %.2f meters", distanceToOffPoint);
485}
486
490- (void)runExample {
491 NSLog(@"=== GeometryUtils Example ===");
492
493 // Wait a bit for processing
494 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
495 NSLog(@"=== Example completed ===");
496 });
497}
498
499@end
500
504int main(int argc, const char * argv[]) {
505 @autoreleasepool {
506 GeometryUtilsExample *example = [[GeometryUtilsExample alloc] init];
507 [example runExample];
508
509 // Keep the app running for a while to see the output
510 [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:10.0]];
511 }
512 return 0;
513}