function PolylineGeometry(options) {
  options = options ?? Frozen.EMPTY_OBJECT;
  const positions = options.positions;
  const colors = options.colors;
  const width = options.width ?? 1.0;
  const colorsPerVertex = options.colorsPerVertex ?? false;

  //>>includeStart('debug', pragmas.debug);
  if (!defined(positions) || positions.length < 2) {
    throw new DeveloperError("At least two positions are required.");
  }
  if (typeof width !== "number") {
    throw new DeveloperError("width must be a number");
  }
  if (
    defined(colors) &&
    ((colorsPerVertex && colors.length < positions.length) ||
      (!colorsPerVertex && colors.length < positions.length - 1))
  ) {
    throw new DeveloperError("colors has an invalid length.");
  }
  //>>includeEnd('debug');

  this._positions = positions;
  this._colors = colors;
  this._width = width;
  this._colorsPerVertex = colorsPerVertex;
  this._vertexFormat = VertexFormat.clone(
    options.vertexFormat ?? VertexFormat.DEFAULT,
  );

  this._arcType = options.arcType ?? ArcType.GEODESIC;
  this._granularity = options.granularity ?? CesiumMath.RADIANS_PER_DEGREE;
  this._ellipsoid = Ellipsoid.clone(options.ellipsoid ?? Ellipsoid.default);
  this._workerName = "createPolylineGeometry";

  let numComponents = 1 + positions.length * Cartesian3.packedLength;
  numComponents += defined(colors) ? 1 + colors.length * Color.packedLength : 1;

  /**
   * The number of elements used to pack the object into an array.
   * @type {number}
   */
  this.packedLength =
    numComponents + Ellipsoid.packedLength + VertexFormat.packedLength + 4;
}
A description of a polyline modeled as a line strip; the first two positions define a line segment,
and each additional position defines a line segment from the previous position. The polyline is capable of
displaying with a material.

@alias PolylineGeometry
@constructor

@param {object} options Object with the following properties:
@param {Cartesian3[]} options.positions An array of {@link Cartesian3} defining the positions in the polyline as a line strip.
@param {number} [options.width=1.0] The width in pixels.
@param {Color[]} [options.colors] An Array of {@link Color} defining the per vertex or per segment colors.
@param {boolean} [options.colorsPerVertex=false] A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices.
@param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polyline segments must follow.
@param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude if options.arcType is not ArcType.NONE. Determines the number of positions in the buffer.
@param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
@param {Ellipsoid} [options.ellipsoid=Ellipsoid.default] The ellipsoid to be used as a reference.

@exception {DeveloperError} At least two positions are required.
@exception {DeveloperError} width must be greater than or equal to one.
@exception {DeveloperError} colors has an invalid length.

@see PolylineGeometry#createGeometry

@demo {@link https://sandcastle.cesium.com/index.html?src=Polyline.html|Cesium Sandcastle Polyline Demo}

@example
// A polyline with two connected line segments
const polyline = new Cesium.PolylineGeometry({
  positions : Cesium.Cartesian3.fromDegreesArray([
    0.0, 0.0,
    5.0, 0.0,
    5.0, 5.0
  ]),
  width : 10.0
});
const geometry = Cesium.PolylineGeometry.createGeometry(polyline);