The Physiologist's Friend Simulation API

ch.unizh.ini.friend.topology
Class HexDirection

java.lang.Object
  extended by ch.unizh.ini.friend.topology.HexDirection

public class HexDirection
extends Object

Represents a topological direction in the hexagonal arrangement of cells in the retina. A direction is represented in the hex arrangement as shown in this image:

Since:
$Revision: 1.4 $
Author:
$Author: cmarti $

Field Summary
protected  int dir
           
static int E
          a hex direction
static int NE
          a hex direction
static int NW
          a hex direction
static int SE
          a hex direction
static int SW
          a hex direction
static int W
          a hex direction
 
Constructor Summary
HexDirection()
          Creates a new instance of Direction with direction set to -1.
HexDirection(int i)
          Creates new instance with given direction.
 
Method Summary
 int get()
          gets the direction as a int, 0-5 CCW from east, non negative.
 double getAngle()
          get angle in radians.
static void main(String[] args)
          tests HexDirection
 void set(int i)
          sets the direction
 String toString()
          returns int direction, 0-5 CCW from east and non negative
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dir

protected int dir

E

public static final int E
a hex direction

See Also:
Constant Field Values

NE

public static final int NE
a hex direction

See Also:
Constant Field Values

NW

public static final int NW
a hex direction

See Also:
Constant Field Values

W

public static final int W
a hex direction

See Also:
Constant Field Values

SW

public static final int SW
a hex direction

See Also:
Constant Field Values

SE

public static final int SE
a hex direction

See Also:
Constant Field Values
Constructor Detail

HexDirection

public HexDirection()
Creates a new instance of Direction with direction set to -1.


HexDirection

public HexDirection(int i)
Creates new instance with given direction.

Method Detail

get

public int get()
gets the direction as a int, 0-5 CCW from east, non negative.


set

public void set(int i)
sets the direction


getAngle

public double getAngle()
get angle in radians. Positive x is angle 0. Increases to Math.PI for CCW rotation, decreases to -Math.PI in CW direction.

Returns:
angle in radians.

main

public static void main(String[] args)
tests HexDirection


toString

public String toString()
returns int direction, 0-5 CCW from east and non negative

Overrides:
toString in class Object

http://www.ini.unizh.ch/~tobi/friend