Show
Ignore:
Timestamp:
09/26/07 02:32:47 (5 years ago)
Author:
cs186
Message:

Make MyStuff? consistent with the source tree!

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • hw/hw2/MyStuff/geo_ops.c

    r32 r47  
    808808} 
    809809 
     810double 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} 
    810820 
    811821/*              box_distance    -               returns the distance between the 
     
    817827        BOX                *box1 = PG_GETARG_BOX_P(0); 
    818828        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); 
    826832} 
    827833 
     
    52485254} 
    52495255 
    5250 /*  
    5251  * return the minimum possible distance between an object contained in box1  
    5252  * and an object contained in box2.  assume that box1 and box2 are minimum  
    5253  * bounding rectangles, so they have some object touching each side. 
    5254  */ 
    52555256double box_mindist_internal(BOX *box1, BOX *box2) 
    52565257{ 
    5257   /* fill me in! */ 
    5258   return get_float8_infinity(); 
     5258  /* CS186 HW2: fill me in! */ 
    52595259} 
    52605260 
     
    52665266        PG_RETURN_FLOAT8(box_mindist_internal(box1, box2)); 
    52675267} 
     5268 
     5269Datum box_true(PG_FUNCTION_ARGS) 
     5270{ 
     5271        PG_RETURN_BOOL(TRUE); 
     5272}