Point2dArrayCarrier Class

Helper object to access members of a Point2d[] in geometric calculations.

  • The collection holds only a reference to the actual array.
  • The actual array may be replaced by the user as needed.
  • When replaced, there is no cached data to be updated.

Extends

Methods

Name Description
constructor(data: Point2d[]): Point2dArrayCarrier CAPTURE caller supplied array ...  
crossProductIndexIndexIndex(originIndex: number, indexA: number, indexB: number): undefined | number Return the cross product of vectors from point at originIndex to points at indexA and indexB  
crossProductXAndYIndexIndex(origin: Readonly<WritableXAndY>, indexA: number, indexB: number): undefined | number Return the cross product of vectors from origin to points at indexA and indexB  
getPoint2dAtCheckedPointIndex(index: number, result?: Point2d): undefined | Point2d Access by index, returning strongly typed Point2d  
getVector2dAtCheckedVectorIndex(index: number, result?: Vector2d): undefined | Vector2d Access by index, returning strongly typed Vector2d  
getXAtUncheckedPointIndex(pointIndex: number): number Get x coordinate by point index, with no index checking  
getYAtUncheckedPointIndex(pointIndex: number): number Get y coordinate by point index, with no index checking  
isValidIndex(index: number): boolean test if index is valid  
vectorIndexIndex(indexA: number, indexB: number, result?: Vector2d): undefined | Vector2d Return a vector from the point at indexA to the point at indexB  
vectorXAndYIndex(origin: Readonly<WritableXAndY>, indexB: number, result?: Vector2d): undefined | Vector2d Return a vector from given origin to point at indexB  

Inherited methods

Name Inherited from Description
linearCombination(scales: number[], result?: Point2d | Vector2d): XY IndexedXYCollection Compute the linear combination s of the indexed p_i and given scales s_i.

Properties

Name Type Description
data Point2d[] reference to array being queried.  
length Accessor ReadOnly number read-only property for number of XYZ in the collection.  

Defined in

Last Updated: 20 June, 2023