movements
Class ParticipantPosition

java.lang.Object
  extended bymovements.Position
      extended bymovements.ParticipantPosition

class ParticipantPosition
extends Position

This class represents the position of a participant. The position of a participant includes the direction in which the participant is facing. This class thus extends Position, adding the direction. Just as in the base class, the co-ordinates are relative to the floor.


Field Summary
(package private)  double across
           
(package private)  double direction
          The direction in which the participant is facing in radians.
(package private)  double down
           
 
Constructor Summary
(package private) ParticipantPosition()
           
(package private) ParticipantPosition(double down, double across, double direction)
           
 
Method Summary
(package private)  boolean isEqual(ParticipantPosition x)
           
(package private)  boolean isNearTo(Position other, int distance)
          Given this position and another position, determines if the two positions are closer to each other than the given distance.
(package private)  void setFromPositionRelativeToPerson(ParticipantPosition personPosition, double positionForwards, double positionSideways)
          Given a position specified relative to the person, calculate the position relative to the dance floor.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

direction

double direction
The direction in which the participant is facing in radians. The following example directions are given in degrees for ease of readability, but the value is stored in radians. 0 = facing down 90 = facing womens' side 180 = facing up 270 = facing mens' side


down

double down

across

double across
Constructor Detail

ParticipantPosition

ParticipantPosition()

ParticipantPosition

ParticipantPosition(double down,
                    double across,
                    double direction)
Method Detail

isEqual

boolean isEqual(ParticipantPosition x)

toString

public java.lang.String toString()
Overrides:
toString in class Position

setFromPositionRelativeToPerson

void setFromPositionRelativeToPerson(ParticipantPosition personPosition,
                                     double positionForwards,
                                     double positionSideways)
Given a position specified relative to the person, calculate the position relative to the dance floor.

The position of the point is given as the distance forward of the person and the distance sideways from the person (left = positive, right = negative).


isNearTo

boolean isNearTo(Position other,
                 int distance)
Given this position and another position, determines if the two positions are closer to each other than the given distance.



Copyright © 2003 Nigel Westbury