function Polyline(options, polylineCollection) {
  options = options ?? Frozen.EMPTY_OBJECT;

  this._show = options.show ?? true;
  this._width = options.width ?? 1.0;
  this._loop = options.loop ?? false;
  this._distanceDisplayCondition = options.distanceDisplayCondition;

  this._material = options.material;
  if (!defined(this._material)) {
    this._material = Material.fromType(Material.ColorType, {
      color: new Color(1.0, 1.0, 1.0, 1.0),
    });
  }

  let positions = options.positions;
  if (!defined(positions)) {
    positions = [];
  }

  this._positions = positions;
  this._actualPositions = arrayRemoveDuplicates(
    positions,
    Cartesian3.equalsEpsilon,
  );

  if (this._loop && this._actualPositions.length > 2) {
    if (this._actualPositions === this._positions) {
      this._actualPositions = positions.slice();
    }
    this._actualPositions.push(Cartesian3.clone(this._actualPositions[0]));
  }

  this._length = this._actualPositions.length;
  this._id = options.id;

  let modelMatrix;
  if (defined(polylineCollection)) {
    modelMatrix = Matrix4.clone(polylineCollection.modelMatrix);
  }

  this._modelMatrix = modelMatrix;
  this._segments = PolylinePipeline.wrapLongitude(
    this._actualPositions,
    modelMatrix,
  );

  this._actualLength = undefined;

  // eslint-disable-next-line no-use-before-define
  this._propertiesChanged = new Uint32Array(NUMBER_OF_PROPERTIES);
  this._polylineCollection = polylineCollection;
  this._dirty = false;
  this._pickId = undefined;
  this._boundingVolume = BoundingSphere.fromPoints(this._actualPositions);
  this._boundingVolumeWC = BoundingSphere.transform(
    this._boundingVolume,
    this._modelMatrix,
  );
  this._boundingVolume2D = new BoundingSphere(); // modified in PolylineCollection
}
<div class="notice">
Create this by calling {@link PolylineCollection#add}. Do not call the constructor directly.
</div>

A renderable polyline.

@alias Polyline
@internalConstructor
@class

@privateParam {object} options Object with the following properties:
@privateParam {boolean} [options.show=true] <code>true</code> if this polyline will be shown; otherwise, <code>false</code>.
@privateParam {number} [options.width=1.0] The width of the polyline in pixels.
@privateParam {boolean} [options.loop=false] Whether a line segment will be added between the last and first line positions to make this line a loop.
@privateParam {Material} [options.material=Material.ColorType] The material.
@privateParam {Cartesian3[]} [options.positions] The positions.
@privateParam {object} [options.id] The user-defined object to be returned when this polyline is picked.
@privateParam {DistanceDisplayCondition} [options.distanceDisplayCondition] The condition specifying at what distance from the camera that this polyline will be displayed.
@privateParam {PolylineCollection} polylineCollection The renderable polyline collection.

@see PolylineCollection