comparison java/src/uk/ac/qmul/eecs/ccmi/gui/Direction.java @ 3:9e67171477bc

PHANTOM Omni Heptic device release
author Fiore Martin <fiore@eecs.qmul.ac.uk>
date Wed, 25 Apr 2012 17:09:09 +0100
parents 9418ab7b7f3f
children d66dd5880081
comparison
equal deleted inserted replaced
2:4b2f975e35fa 3:9e67171477bc
54 { 54 {
55 this(q.getX() - p.getX(), 55 this(q.getX() - p.getX(),
56 q.getY() - p.getY()); 56 q.getY() - p.getY());
57 } 57 }
58 58
59 /**
60 * Checks whether the direction passed as argument is parallel to this direction.
61 *
62 * @param d the direction to check against
63 * @return {@code true} if this direction and {@code d} are parallel to each other, false otherwise
64 */
59 public boolean isParallel(Direction d){ 65 public boolean isParallel(Direction d){
60 if(equals(d.x,d.y,DELTA)||turn(180).equals(d.x,d.y,DELTA)) 66 if(equals(d.x,d.y,DELTA)||turn(180).equals(d.x,d.y,DELTA))
61 return true; 67 return true;
62 else 68 else
63 return false; 69 return false;