getOrdinate method

double getOrdinate(
  1. int ordinateIndex
)
override

Gets the ordinate value for the given index.

The base implementation supports values for the index are {@link X}, {@link Y}, and {@link Z}.

@param ordinateIndex the ordinate index @return the value of the ordinate @throws IllegalArgumentException if the index is not valid

Implementation

double getOrdinate(int ordinateIndex) {
  switch (ordinateIndex) {
    case X:
      return x;
    case Y:
      return y;
    case M:
      return m;
  }
  throw new ArgumentError("Invalid ordinate index: $ordinateIndex");
}