HexCell (Lab1)
Class HexCell
java.lang.Object
|
+--Cell
|
+--HexCell
- public class HexCell
- extends Cell
A Hexagonal Cell Area
- Version:
- 1.0 (2002)
- Author:
- CPwJ
|
Constructor Summary |
HexCell(double x,
double y,
double r)
Define HexCellconstructor |
|
Method Summary |
double |
area()
Calculate the area of a Hexagonal shape Cell |
boolean |
coverage(double x,
double y)
Check whether a point is covered by the Hex cell |
HexCell
public HexCell(double x,
double y,
double r)
- Define HexCellconstructor
- Parameters:
x - Cell X coordinatey - Cell Y coordinater - Cell Radius
area
public double area()
- Calculate the area of a Hexagonal shape Cell
- Specified by:
area in class Cell
- Returns:
- the area of the Hexagonal Cell
coverage
public boolean coverage(double x,
double y)
- Check whether a point is covered by the Hex cell
- Overrides:
coverage in class Cell
- Parameters:
x - The x point of access coordinatey - The y point of access coordinate
- Returns:
- True/False
Generated by BlueJ