setOrdinate method

void setOrdinate(
  1. int ordinateIndex,
  2. double value
)
override

Sets the ordinate for the given index to a given value.

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

@param ordinateIndex the ordinate index @param value the value to set @throws IllegalArgumentException if the index is not valid

Implementation

void setOrdinate(int ordinateIndex, double value) {
  switch (ordinateIndex) {
    case X:
      x = value;
      break;
    case Y:
      y = value;
      break;
    case M:
      m = value;
      break;
    default:
      throw new ArgumentError("Invalid ordinate index: $ordinateIndex");
  }
}