Point.st
changeset 8452 6f4318707476
parent 8451 a833cbb5e601
child 8791 1171ee15fa9c
equal deleted inserted replaced
8451:a833cbb5e601 8452:6f4318707476
   760      multiplied and the coordinates of the result summed."
   760      multiplied and the coordinates of the result summed."
   761 
   761 
   762     ^ (x * aPoint x) + (y * aPoint y)
   762     ^ (x * aPoint x) + (y * aPoint y)
   763 !
   763 !
   764 
   764 
       
   765 fourNeighbors
       
   766     ^ Array 
       
   767         with: self + (1@0)
       
   768         with: self + (0@1)
       
   769         with: self + (-1@0)
       
   770         with: self + (0@-1)
       
   771 !
       
   772 
   765 grid:gridPoint
   773 grid:gridPoint
   766     "return a new point with coordinates grided (i.e. rounded to the
   774     "return a new point with coordinates grided (i.e. rounded to the
   767      nearest point on the grid)"
   775      nearest point on the grid)"
   768 
   776 
   769     |newX newY gridX gridY|
   777     |newX newY gridX gridY|
  1142 ! !
  1150 ! !
  1143 
  1151 
  1144 !Point class methodsFor:'documentation'!
  1152 !Point class methodsFor:'documentation'!
  1145 
  1153 
  1146 version
  1154 version
  1147     ^ '$Header: /cvs/stx/stx/libbasic/Point.st,v 1.66 2004-07-16 13:35:43 cg Exp $'
  1155     ^ '$Header: /cvs/stx/stx/libbasic/Point.st,v 1.67 2004-07-16 13:37:16 cg Exp $'
  1148 ! !
  1156 ! !
  1149 
  1157 
  1150 Point initialize!
  1158 Point initialize!