Changeset 47 for hw/hw2/MyStuff/geo_ops.c
- Timestamp:
- 09/26/07 02:32:47 (5 years ago)
- Files:
-
- 1 modified
-
hw/hw2/MyStuff/geo_ops.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
hw/hw2/MyStuff/geo_ops.c
r32 r47 808 808 } 809 809 810 double box_distance_internal(BOX *box1, BOX *box2) 811 { 812 Point a, 813 b; 814 815 box_cn(&a, box1); 816 box_cn(&b, box2); 817 return(HYPOT(a.x - b.x, a.y - b.y)); 818 819 } 810 820 811 821 /* box_distance - returns the distance between the … … 817 827 BOX *box1 = PG_GETARG_BOX_P(0); 818 828 BOX *box2 = PG_GETARG_BOX_P(1); 819 Point a, 820 b; 821 822 box_cn(&a, box1); 823 box_cn(&b, box2); 824 825 PG_RETURN_FLOAT8(HYPOT(a.x - b.x, a.y - b.y)); 829 double result = box_distance_internal(box1, box2); 830 831 PG_RETURN_FLOAT8(result); 826 832 } 827 833 … … 5248 5254 } 5249 5255 5250 /*5251 * return the minimum possible distance between an object contained in box15252 * and an object contained in box2. assume that box1 and box2 are minimum5253 * bounding rectangles, so they have some object touching each side.5254 */5255 5256 double box_mindist_internal(BOX *box1, BOX *box2) 5256 5257 { 5257 /* fill me in! */ 5258 return get_float8_infinity(); 5258 /* CS186 HW2: fill me in! */ 5259 5259 } 5260 5260 … … 5266 5266 PG_RETURN_FLOAT8(box_mindist_internal(box1, box2)); 5267 5267 } 5268 5269 Datum box_true(PG_FUNCTION_ARGS) 5270 { 5271 PG_RETURN_BOOL(TRUE); 5272 }
