/// <summary> /// Set the coordinate value. /// </summary> /// <param name="coord"></param> /// <param name="unit"></param> public void SetCoordinate(double[] coord, Units.LinearUnit unit) { if (coord.Length != Dimension) { throw new GeodeticException("The coordinate length is invalid."); } _coord = coord; Unit = unit; }
/// <summary> /// Get the coordinate value to a array. /// </summary> /// <param name="unit"></param> /// <returns></returns> public double[] GetCoordinate(Units.LinearUnit unit) { double[] coord = new double[Dimension]; for (int i = Dimension - 1; i >= 0; i--) { coord[i] = _coord[i] * Unit.Factor / unit.Factor; } return coord; }