Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Pt

Pt is a subclass of Float32Array with additional properties and functions to support vector and geometric calculations. See Pt guide for details

Hierarchy

Implements

  • IPt
  • Iterable<number>

Indexable

[index: number]: number

Pt is a subclass of Float32Array with additional properties and functions to support vector and geometric calculations. See Pt guide for details

Index

Constructors

constructor

  • new Pt(...args: any[]): Pt
  • Create a Pt. If no parameter is provided, this will instantiate a Pt with 2 dimensions [0, 0].

    Note that new Pt(3) will only instantiate Pt with length of 3 (ie, same as new Float32Array(3) ). If you need a Pt with 1 dimension of value 3, use new Pt([3]).

    example

    new Pt(), new Pt(1,2,3,4,5), new Pt([1,2]), new Pt({x:0, y:1}), new Pt(pt)

    Parameters

    • Rest ...args: any[]

      a list of numeric parameters, an array of numbers, or an object with {x,y,z,w} properties

    Returns Pt

Properties

Protected _id

_id: string

Static BYTES_PER_ELEMENT

BYTES_PER_ELEMENT: number

The size in bytes of each element in the array.

Static Float32Array

Float32Array: Float32ArrayConstructor

Static __@toStringTag

__@toStringTag: "Float32Array"

Static buffer

buffer: ArrayBuffer

The ArrayBuffer instance referenced by the array.

Static byteLength

byteLength: number

The length in bytes of the array.

Static byteOffset

byteOffset: number

The offset in bytes of the array.

Static length

length: number

The length of the array.

Accessors

id

  • get id(): string
  • set id(s: string): void
  • Returns string

  • Parameters

    • s: string

    Returns void

w

  • get w(): number
  • set w(n: number): void
  • Returns number

  • Parameters

    • n: number

    Returns void

x

  • get x(): number
  • set x(n: number): void
  • Returns number

  • Parameters

    • n: number

    Returns void

y

  • get y(): number
  • set y(n: number): void
  • Returns number

  • Parameters

    • n: number

    Returns void

z

  • get z(): number
  • set z(n: number): void
  • Returns number

  • Parameters

    • n: number

    Returns void

Methods

$abs

  • $abs(): Pt
  • Get a new Pt with absolute values of this Pt

    Returns Pt

$add

  • $add(...args: any[]): Pt
  • Like add, but returns result as a new Pt

    Parameters

    • Rest ...args: any[]

    Returns Pt

$ceil

  • $ceil(): Pt
  • Get a new Pt with ceil values of this Pt

    Returns Pt

$concat

  • $concat(...args: any[]): Pt
  • Concatenate this Pt with addition dimensional values and return as a new Pt

    Parameters

    • Rest ...args: any[]

      a list of numbers, an array of number, or an object with {x,y,z,w} properties

    Returns Pt

$cross

  • $cross(...args: any[]): Pt
  • 3D Cross product of this Pt and another Pt. Return results as a new Pt.

    Parameters

    • Rest ...args: any[]

      a list of numbers, an array of number, or an object with {x,y,z,w} properties

    Returns Pt

$divide

  • $divide(...args: any[]): Pt
  • Like divide, but returns result as a new Pt

    Parameters

    • Rest ...args: any[]

    Returns Pt

$floor

  • $floor(): Pt
  • Get a new Pt with floor values of this Pt

    Returns Pt

$max

  • $max(...args: any[]): Pt
  • Get a new Pt that has the maximum dimensional values of this Pt and another Pt

    Parameters

    • Rest ...args: any[]

      a list of numbers, an array of number, or an object with {x,y,z,w} properties

    Returns Pt

$min

  • $min(...args: any[]): Pt
  • Get a new Pt that has the minimum dimensional values of this Pt and another Pt

    Parameters

    • Rest ...args: any[]

      a list of numbers, an array of number, or an object with {x,y,z,w} properties

    Returns Pt

$multiply

  • $multiply(...args: any[]): Pt
  • Like multiply, but returns result as a new Pt

    Parameters

    • Rest ...args: any[]

    Returns Pt

$project

  • $project(p: Pt): Pt
  • Calculate vector projection of this Pt on another Pt. Returns result as a new Pt.

    Parameters

    • p: Pt

      a list of numbers, an array of number, or an object with {x,y,z,w} properties

    Returns Pt

$round

  • $round(): Pt
  • Get a new Pt with round values of this Pt

    Returns Pt

$subtract

  • $subtract(...args: any[]): Pt
  • Like subtract, but returns result as a new Pt

    Parameters

    • Rest ...args: any[]

    Returns Pt

$take

  • $take(axis: string | number[]): Pt
  • Take specific dimensional values from this Pt and create a new Pt

    Parameters

    • axis: string | number[]

      a string such as "xy" (use Const.xy) or an array to specify index for two dimensions

    Returns Pt

$to

  • $to(...args: any[]): Pt
  • Like to() but returns a new Pt

    Parameters

    • Rest ...args: any[]

      a list of numbers, an array of number, or an object with {x,y,z,w} properties

    Returns Pt

$unit

  • $unit(magnitude?: number): Pt
  • Get a unit vector from this Pt

    Parameters

    • Default value magnitude: number = undefined

    Returns Pt

abs

  • abs(): Pt
  • Absolute values for all values in this pt

    Returns Pt

add

  • add(...args: any[]): this
  • Add scalar or vector values to this Pt

    Parameters

    • Rest ...args: any[]

      a list of numbers, an array of number, or an object with {x,y,z,w} properties

    Returns this

angle

  • angle(axis?: string | number[]): number
  • Get angle of this vector from origin

    Parameters

    • Default value axis: string | number[] = Const.xy

      a string such as "xy" (use Const.xy) or an array to specify index for two dimensions

    Returns number

angleBetween

  • angleBetween(p: Pt, axis?: string | number[]): number
  • Get the angle between this and another Pt

    Parameters

    • p: Pt

      the other Pt

    • Default value axis: string | number[] = Const.xy

      a string such as "xy" (use Const.xy) or an array to specify index for two dimensions

    Returns number

ceil

  • ceil(): Pt
  • Ceil values for all values in this pt

    Returns Pt

clone

  • clone(): Pt

cross2D

  • cross2D(...args: any[]): number
  • 2D Cross product of this Pt and another Pt. Return results as a new Pt.

    Parameters

    • Rest ...args: any[]

      a list of numbers, an array of number, or an object with {x,y,z,w} properties

    Returns number

divide

  • divide(...args: any[]): this
  • Divide this Pt over scalar or vector values (as element-wise)

    Parameters

    • Rest ...args: any[]

      a list of numbers, an array of number, or an object with {x,y,z,w} properties

    Returns this

dot

  • dot(...args: any[]): number
  • Dot product of this Pt and another Pt

    Parameters

    • Rest ...args: any[]

      a list of numbers, an array of number, or an object with {x,y,z,w} properties

    Returns number

equals

  • equals(p: PtLike, threshold?: number): boolean
  • Check if another Pt is equal to this Pt, within a threshold

    Parameters

    • p: PtLike

      another Pt to compare with

    • Default value threshold: number = 0.000001

      a threshold value within which the two Pts are considered equal. Default is 0.000001.

    Returns boolean

floor

  • floor(): Pt
  • Floor values for all values in this pt

    Returns Pt

magnitude

  • magnitude(): number
  • Get the distance (magnitude) of this Pt from origin

    Returns number

magnitudeSq

  • magnitudeSq(): number
  • Get the sqaured distance (magnitude) of this Pt from origin

    Returns number

maxValue

  • maxValue(): object
  • Find the maximum value across all dimensions in this Pt

    Returns object

    an object with value and index which returns the maximum value and its dimensional index

    • index: number
    • value: number

minValue

  • minValue(): object
  • Find the minimum value across all dimensions in this Pt

    Returns object

    an object with value and index which returns the minimum value and its dimensional index

    • index: number
    • value: number

multiply

  • multiply(...args: any[]): this
  • Multiply scalar or vector values (as element-wise) with this Pt.

    Parameters

    • Rest ...args: any[]

      a list of numbers, an array of number, or an object with {x,y,z,w} properties

    Returns this

op

  • op(fn: function): function
  • Create an operation using this Pt, passing this Pt into a custom function's first parameter. See the Op guide for details. For example: let myOp = pt.op( fn ); let result = myOp( [1,2,3] );

    Parameters

    • fn: function

      any function that takes a Pt as its first parameter

        • (p1: PtLike, ...rest: any[]): any
        • Parameters

          • p1: PtLike
          • Rest ...rest: any[]

          Returns any

    Returns function

    a resulting function that takes other parameters required in fn

      • (...rest: any[]): any
      • Parameters

        • Rest ...rest: any[]

        Returns any

ops

  • ops(fns: function[]): function[]
  • This combines a series of operations into an array. See op() for details. For example: let myOps = pt.ops([fn1, fn2, fn3]); let results = myOps.map( (op) => op([1,2,3]) );

    Parameters

    • fns: function[]

      an array of functions for op

    Returns function[]

    an array of resulting functions

reflect2D

  • reflect2D(line: GroupLike, axis?: string): this
  • Reflect this Pt along a 2D line

    Parameters

    • line: GroupLike

      a Group of 2 Pts that defines a line for reflection

    • Optional axis: string

      optional axis such as "yz" to define a 2D plane of reflection

    Returns this

rotate2D

  • rotate2D(angle: number, anchor?: PtLike, axis?: string): this
  • Rotate this Pt from origin or from an anchor point in 2D

    Parameters

    • angle: number

      rotate angle

    • Optional anchor: PtLike

      optional anchor point to scale from

    • Optional axis: string

      optional string such as "yz" to specify a 2D plane

    Returns this

round

  • round(): Pt
  • Round values for all values in this pt

    Returns Pt

scale

  • scale(scale: number | number[] | PtLike, anchor?: PtLike): this
  • Scale this Pt from origin or from an anchor point

    Parameters

    • scale: number | number[] | PtLike

      scale ratio

    • Optional anchor: PtLike

      optional anchor point to scale from

    Returns this

shear2D

  • shear2D(scale: number | number[] | PtLike, anchor?: PtLike, axis?: string): this
  • Shear this Pt from origin or from an anchor point in 2D

    Parameters

    • scale: number | number[] | PtLike
    • Optional anchor: PtLike

      optional anchor point to scale from

    • Optional axis: string

      optional string such as "yz" to specify a 2D plane

    Returns this

subtract

  • subtract(...args: any[]): this
  • Subtract scalar or vector values from this Pt

    Parameters

    • Rest ...args: any[]

      a list of numbers, an array of number, or an object with {x,y,z,w} properties

    Returns this

to

  • to(...args: any[]): this
  • Update the values of this Pt

    Parameters

    • Rest ...args: any[]

      a list of numbers, an array of number, or an object with {x,y,z,w} properties

    Returns this

toAngle

  • toAngle(radian: number, magnitude?: number, anchorFromPt?: boolean): this
  • Update the values of this Pt to point at a specific angle

    Parameters

    • radian: number

      target angle in radian

    • Optional magnitude: number

      Optional magnitude if known. If not provided, it'll calculate and use this Pt's magnitude.

    • Default value anchorFromPt: boolean = false

      If true, translate to new position from current position. Default is false which update the position from origin (0,0);

    Returns this

toArray

  • toArray(): number[]
  • Convert this Pt to a javascript Array

    Returns number[]

toString

  • toString(): string
  • A string representation of this Pt: "Pt(1, 2, 3)"

    Returns string

unit

  • unit(magnitude?: number): Pt
  • Convert to a unit vector, which is a normalized vector whose magnitude equals 1.

    Parameters

    • Default value magnitude: number = undefined

      Optional: if the magnitude is known, pass it as a parameter to avoid duplicate calculation.

    Returns Pt

Static __@iterator

  • __@iterator(): IterableIterator<number>
  • Returns IterableIterator<number>

Static copyWithin

  • copyWithin(target: number, start: number, end?: number): this
  • Returns the this object after copying a section of the array identified by start and end to the same array starting at position target

    Parameters

    • target: number

      If target is negative, it is treated as length+target where length is the length of the array.

    • start: number

      If start is negative, it is treated as length+start. If end is negative, it is treated as length+end.

    • Optional end: number

      If not specified, length of the this object is used as its default value.

    Returns this

Static entries

  • entries(): IterableIterator<[number, number]>
  • Returns an array of key, value pairs for every entry in the array

    Returns IterableIterator<[number, number]>

Static every

  • every(callbackfn: function): boolean
  • every(callbackfn: function, thisArg: undefined): boolean
  • every<Z>(callbackfn: function, thisArg: Z): boolean
  • Determines whether all the members of an array satisfy the specified test.

    Parameters

    • callbackfn: function

      A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.

        • (this: void, value: number, index: number, array: Float32Array): boolean
        • Parameters

          • this: void
          • value: number
          • index: number
          • array: Float32Array

          Returns boolean

    Returns boolean

  • Parameters

    • callbackfn: function
        • (this: void, value: number, index: number, array: Float32Array): boolean
        • Parameters

          • this: void
          • value: number
          • index: number
          • array: Float32Array

          Returns boolean

    • thisArg: undefined

    Returns boolean

  • Type parameters

    • Z

    Parameters

    • callbackfn: function
        • (this: Z, value: number, index: number, array: Float32Array): boolean
        • Parameters

          • this: Z
          • value: number
          • index: number
          • array: Float32Array

          Returns boolean

    • thisArg: Z

    Returns boolean

Static fill

  • fill(value: number, start?: number, end?: number): this
  • Returns the this object after filling the section identified by start and end with value

    Parameters

    • value: number

      value to fill array section with

    • Optional start: number

      index to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array.

    • Optional end: number

      index to stop filling the array at. If end is negative, it is treated as length+end.

    Returns this

Static filter

  • filter(callbackfn: function): Float32Array
  • filter(callbackfn: function, thisArg: undefined): Float32Array
  • filter<Z>(callbackfn: function, thisArg: Z): Float32Array
  • Returns the elements of an array that meet the condition specified in a callback function.

    Parameters

    • callbackfn: function

      A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.

        • (this: void, value: number, index: number, array: Float32Array): any
        • Parameters

          • this: void
          • value: number
          • index: number
          • array: Float32Array

          Returns any

    Returns Float32Array

  • Parameters

    • callbackfn: function
        • (this: void, value: number, index: number, array: Float32Array): any
        • Parameters

          • this: void
          • value: number
          • index: number
          • array: Float32Array

          Returns any

    • thisArg: undefined

    Returns Float32Array

  • Type parameters

    • Z

    Parameters

    • callbackfn: function
        • (this: Z, value: number, index: number, array: Float32Array): any
        • Parameters

          • this: Z
          • value: number
          • index: number
          • array: Float32Array

          Returns any

    • thisArg: Z

    Returns Float32Array

Static find

  • find(predicate: function): number | undefined
  • find(predicate: function, thisArg: undefined): number | undefined
  • find<Z>(predicate: function, thisArg: Z): number | undefined
  • Returns the value of the first element in the array where predicate is true, and undefined otherwise.

    Parameters

    • predicate: function

      find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, find immediately returns that element value. Otherwise, find returns undefined.

        • (this: void, value: number, index: number, obj: Array<number>): boolean
        • Parameters

          • this: void
          • value: number
          • index: number
          • obj: Array<number>

          Returns boolean

    Returns number | undefined

  • Parameters

    • predicate: function
        • (this: void, value: number, index: number, obj: Array<number>): boolean
        • Parameters

          • this: void
          • value: number
          • index: number
          • obj: Array<number>

          Returns boolean

    • thisArg: undefined

    Returns number | undefined

  • Type parameters

    • Z

    Parameters

    • predicate: function
        • (this: Z, value: number, index: number, obj: Array<number>): boolean
        • Parameters

          • this: Z
          • value: number
          • index: number
          • obj: Array<number>

          Returns boolean

    • thisArg: Z

    Returns number | undefined

Static findIndex

  • findIndex(predicate: function): number
  • findIndex(predicate: function, thisArg: undefined): number
  • findIndex<Z>(predicate: function, thisArg: Z): number
  • Returns the index of the first element in the array where predicate is true, and -1 otherwise.

    Parameters

    • predicate: function

      find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, findIndex immediately returns that element index. Otherwise, findIndex returns -1.

        • (this: void, value: number, index: number, obj: Array<number>): boolean
        • Parameters

          • this: void
          • value: number
          • index: number
          • obj: Array<number>

          Returns boolean

    Returns number

  • Parameters

    • predicate: function
        • (this: void, value: number, index: number, obj: Array<number>): boolean
        • Parameters

          • this: void
          • value: number
          • index: number
          • obj: Array<number>

          Returns boolean

    • thisArg: undefined

    Returns number

  • Type parameters

    • Z

    Parameters

    • predicate: function
        • (this: Z, value: number, index: number, obj: Array<number>): boolean
        • Parameters

          • this: Z
          • value: number
          • index: number
          • obj: Array<number>

          Returns boolean

    • thisArg: Z

    Returns number

Static forEach

  • forEach(callbackfn: function): void
  • forEach(callbackfn: function, thisArg: undefined): void
  • forEach<Z>(callbackfn: function, thisArg: Z): void
  • Performs the specified action for each element in an array.

    Parameters

    • callbackfn: function

      A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.

        • (this: void, value: number, index: number, array: Float32Array): void
        • Parameters

          • this: void
          • value: number
          • index: number
          • array: Float32Array

          Returns void

    Returns void

  • Parameters

    • callbackfn: function
        • (this: void, value: number, index: number, array: Float32Array): void
        • Parameters

          • this: void
          • value: number
          • index: number
          • array: Float32Array

          Returns void

    • thisArg: undefined

    Returns void

  • Type parameters

    • Z

    Parameters

    • callbackfn: function
        • (this: Z, value: number, index: number, array: Float32Array): void
        • Parameters

          • this: Z
          • value: number
          • index: number
          • array: Float32Array

          Returns void

    • thisArg: Z

    Returns void

Static indexOf

  • indexOf(searchElement: number, fromIndex?: number): number
  • Returns the index of the first occurrence of a value in an array.

    Parameters

    • searchElement: number

      The value to locate in the array.

    • Optional fromIndex: number

      The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.

    Returns number

Static join

  • join(separator?: string): string
  • Adds all the elements of an array separated by the specified separator string.

    Parameters

    • Optional separator: string

      A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.

    Returns string

Static keys

  • keys(): IterableIterator<number>
  • Returns an list of keys in the array

    Returns IterableIterator<number>

Static lastIndexOf

  • lastIndexOf(searchElement: number, fromIndex?: number): number
  • Returns the index of the last occurrence of a value in an array.

    Parameters

    • searchElement: number

      The value to locate in the array.

    • Optional fromIndex: number

      The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.

    Returns number

Static make

  • make(dimensions: number, defaultValue?: number, randomize?: boolean): Pt
  • Parameters

    • dimensions: number
    • Default value defaultValue: number = 0
    • Default value randomize: boolean = false

    Returns Pt

Static map

  • map(callbackfn: function): Float32Array
  • map(callbackfn: function, thisArg: undefined): Float32Array
  • map<Z>(callbackfn: function, thisArg: Z): Float32Array
  • Calls a defined callback function on each element of an array, and returns an array that contains the results.

    Parameters

    • callbackfn: function

      A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.

        • (this: void, value: number, index: number, array: Float32Array): number
        • Parameters

          • this: void
          • value: number
          • index: number
          • array: Float32Array

          Returns number

    Returns Float32Array

  • Parameters

    • callbackfn: function
        • (this: void, value: number, index: number, array: Float32Array): number
        • Parameters

          • this: void
          • value: number
          • index: number
          • array: Float32Array

          Returns number

    • thisArg: undefined

    Returns Float32Array

  • Type parameters

    • Z

    Parameters

    • callbackfn: function
        • (this: Z, value: number, index: number, array: Float32Array): number
        • Parameters

          • this: Z
          • value: number
          • index: number
          • array: Float32Array

          Returns number

    • thisArg: Z

    Returns Float32Array

Static reduce

  • reduce(callbackfn: function, initialValue?: number): number
  • reduce<U>(callbackfn: function, initialValue: U): U
  • Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

    Parameters

    • callbackfn: function

      A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

        • (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array): number
        • Parameters

          • previousValue: number
          • currentValue: number
          • currentIndex: number
          • array: Float32Array

          Returns number

    • Optional initialValue: number

      If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

    Returns number

  • Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

    Type parameters

    • U

    Parameters

    • callbackfn: function

      A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

        • (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array): U
        • Parameters

          • previousValue: U
          • currentValue: number
          • currentIndex: number
          • array: Float32Array

          Returns U

    • initialValue: U

      If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

    Returns U

Static reduceRight

  • reduceRight(callbackfn: function, initialValue?: number): number
  • reduceRight<U>(callbackfn: function, initialValue: U): U
  • Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

    Parameters

    • callbackfn: function

      A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.

        • (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array): number
        • Parameters

          • previousValue: number
          • currentValue: number
          • currentIndex: number
          • array: Float32Array

          Returns number

    • Optional initialValue: number

      If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

    Returns number

  • Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

    Type parameters

    • U

    Parameters

    • callbackfn: function

      A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.

        • (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array): U
        • Parameters

          • previousValue: U
          • currentValue: number
          • currentIndex: number
          • array: Float32Array

          Returns U

    • initialValue: U

      If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

    Returns U

Static reverse

  • reverse(): Float32Array
  • Reverses the elements in an Array.

    Returns Float32Array

Static set

  • set(array: ArrayLike<number>, offset?: number): void
  • Sets a value or an array of values.

    Parameters

    • array: ArrayLike<number>

      A typed or untyped array of values to set.

    • Optional offset: number

      The index in the current array at which the values are to be written.

    Returns void

Static slice

  • slice(start?: number, end?: number): Float32Array
  • Returns a section of an array.

    Parameters

    • Optional start: number

      The beginning of the specified portion of the array.

    • Optional end: number

      The end of the specified portion of the array.

    Returns Float32Array

Static some

  • some(callbackfn: function): boolean
  • some(callbackfn: function, thisArg: undefined): boolean
  • some<Z>(callbackfn: function, thisArg: Z): boolean
  • Determines whether the specified callback function returns true for any element of an array.

    Parameters

    • callbackfn: function

      A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.

        • (this: void, value: number, index: number, array: Float32Array): boolean
        • Parameters

          • this: void
          • value: number
          • index: number
          • array: Float32Array

          Returns boolean

    Returns boolean

  • Parameters

    • callbackfn: function
        • (this: void, value: number, index: number, array: Float32Array): boolean
        • Parameters

          • this: void
          • value: number
          • index: number
          • array: Float32Array

          Returns boolean

    • thisArg: undefined

    Returns boolean

  • Type parameters

    • Z

    Parameters

    • callbackfn: function
        • (this: Z, value: number, index: number, array: Float32Array): boolean
        • Parameters

          • this: Z
          • value: number
          • index: number
          • array: Float32Array

          Returns boolean

    • thisArg: Z

    Returns boolean

Static sort

  • sort(compareFn?: function): this
  • Sorts an array.

    Parameters

    • Optional compareFn: function

      The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order.

        • (a: number, b: number): number
        • Parameters

          • a: number
          • b: number

          Returns number

    Returns this

Static subarray

  • subarray(begin: number, end?: number): Float32Array
  • Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements at begin, inclusive, up to end, exclusive.

    Parameters

    • begin: number

      The index of the beginning of the array.

    • Optional end: number

      The index of the end of the array.

    Returns Float32Array

Static toLocaleString

  • toLocaleString(): string
  • Converts a number to a string by using the current locale.

    Returns string

Static toString

  • toString(): string
  • Returns a string representation of an array.

    Returns string

Static values

  • values(): IterableIterator<number>
  • Returns an list of values in the array

    Returns IterableIterator<number>

Generated using TypeDoc